It is possible. You have different possibilities:
a) Create a VPN (Virtual Private Network) between your friend's house and your house. With this solution, you will find your robot in your friend's network.
b) Configure your router to forward one public port of your public IP to your Nao's IP. Now you can send commands to your house's IP. The commands will be forwarded to the robot.
Indeed is the same problem that if you want to get the public IP of your laptop or tablet.