That is the point of hamachi, it is supposed to allow connections without having to set up rules for each network you set up.
In effect it allows you to set them up as local networks. While it could be a slight security risk, as long as you don't give the network info and password out to any but your friends it is minimal as long as you trust your friends. Once you close the connection via Hamachi, afaik any security holes would close as the network would be shut down.
As to any viruses infecting your friends computer affecting yours(as raised in your comments):
Maybe, but I would think the risk would be minimal(your root files should still be safe, only your home would be at risk) First if your friends are using Windows, any virus that they have would be ineffective if it could even manage to get into your system- Windows and Linux work so differently that there are few, if any viruses that can effect both.
If your friends happen to be using Linux and they are infected there may be more risk, but when using Hamachi, you are operating as a server so the virus (more a trojan here) would have to know that 1. You were a server 2. You were connected via a Hamachi type connection and be able to break out of that connection to get back to the author. While I suppose this is all possible, it would require a lot of work on the part of the hacker that wrote the trojan.
Let my pose a question here to put your mind at ease, do you think he would go to all that work to find a random host, find that host in the small window that it is open so that he could use it, just to have all that work go for naught when you shut the server down in an hour or so? I would think he would be more likely to put his time into a more guaranteed target.
The security hole I would be worried about would be one of the friends you have connected to be actively trying to hack into your system.
As long as you don't give the info to anyone you don't trust or leave the connection open after you are done with it, that risk is very small- likely less that you assume when you just surf the internet at large.