Nono, Emulation is not always illegal. Just because most people use their emulators with copyrighted software doesn't mean that the emulators are illegal.
But emulators (at least most of them) require a sort of ROM image with the bios/operating system. The bios is of course also copyrighted. How you can obtain the bios legally depends on the system you want to emulate.
There are systems where the bios and many games have been released into the public domain e.g. the ZX Spectrum: worldofspectrum.org.