Emulators are 100% legal as long as they don't include any unlicensed code from the console manufacturers. This is why emulator authors will tell you to find the system BIOS elsewhere if it's required. ROMs are a different story and the legality of owning them changes depending on the country you're in.