Yes, downloading and using emulators are legal. But you cannot download copyrighted ROMs for games as it's illegal and might get you in trouble.