Emulator apps are generally treated as legal, but the game files (ROMs) are another matter. The accepted rule is that you need to own a physical copy of the game for the same console and make the file yourself by copying it from your own disc or cartridge. Downloading ROMs of games you do not own is illegal.
Nintendo in particular protects its hardware hard. It sued the team behind Yuzu, a Nintendo Switch emulator, which ended in a $2.4 million settlement and led several other developers to drop similar projects. So far, neither Nintendo nor Sony has gone after emulators for older consoles that are no longer on sale.
Preservation groups argue emulation matters for history, too. A 2023 study by the Video Game History Foundation and the Software Preservation Network found that about 87% of classic games had effectively disappeared.