No, but you do have to allow them access somehow. You can grant certain IP addresses access, so you can allow your friends in and block everyone else out. Or you can open up particular ports, depending on what game you're using. What you have to do varies based on the game and whether you have a hardware or a software firewall (or both), as well as how you want to grant access. Of course, the easiest thing would be to take down the firewall entirely, but I wouldn't recommend that
Are you asking about a specific game or just in general?