Think of RetroPie as being like a media player and think of game ROMs as being like MP3s.
Are game roms illegal. The IP of the ROM is public domain. So in the US emulation is legal but downloading a copyrighted ROM from a random website is illegal. Its a gray area but the legal consensus in most places seems to be that an emulator in and of itself is not illegal - its what you do with it.
Video game ROMs are illegal even if you own a physical copy of the titles. Emulators are legal to download and use however sharing copyrighted ROMs online is illegal. Yes Downloading Nintendo ROMs Is Illegal Even if You Own the Game If youre hosting the site you potentially could be liable for direct infringement of a copyright in the game as well as the emulator may have software of some of the code from the console or platform that the game runs on.
Downloading unauthorized ROMs is a form of copyright infringement and is illegal much like. Nintendo explains it pretty well on their legal page. Is downloading ROM Hacks illegal.
However legislation has been passed to prevent software piracy that makes game copying devices illegal. Are Pokemon ROMs legal. Some games are actually illegal to download because of Virtual Console and PSN.
ROMs like Hellfire Taco said are illegal but not the emulator itself. While those sites were sharing Nintendo ROMs the act of downloading them is also likely illegal even if you already own those games on an old cartridge or disc. Unfortunately this is widespread belief is incorrect.
Using such a device to create a ROM image makes the resulting image illegal as well. You can get in trouble for downloading ROMs of games no longer sold as well and hosting illegal content is illegal too. Are game ROMs illegal.