Emulators are 100% legal, as is the process of downloading them. They are no different to other programs you might download such as word processing or music player software. Downloading and uploading ROMs is illegal, however, so make sure you use your own game files.