Yes, Steam Deck can run older console games
Steam Deck runs SteamOS, a Linux-based system, and unlike a typical console it gives you full desktop access. That means you can install emulation software the same way you would on a PC. It's one of the most common reasons people pick up a Steam Deck alongside its native Steam library.
What Steam Deck handles well
Generally speaking, the older and less graphically demanding a system is, the better it runs. Handhelds and consoles up through the PS2/GameCube generation tend to run smoothly. Sixth and seventh generation systems (PS3, Xbox 360, Wii U) are more demanding and results vary a lot by game.
How people usually set it up
Most Steam Deck owners use an all-in-one emulation frontend (EmuDeck is the most popular) that installs and organizes multiple emulators through RetroArch and standalone cores. Setup is done through Desktop Mode, and most guides walk through installing the frontend, then adding it back to your Steam library as a shortcut so it launches in Game Mode.
Storage matters
Steam Deck's internal storage fills up fast once you add a full library, so most people expand with a microSD card. Speed matters for load times on emulated PS2/GameCube-era games in particular — a slow card is a common source of stutter that gets mistaken for an emulation problem.
A note on legality
Emulation software itself is legal. What matters is the game files you run on it: you're on solid ground dumping game backups from discs or cartridges you own, and on much shakier ground downloading files for games you don't own. Worth keeping in mind before you go looking for a library to fill your new setup.
If you want more power
If you're finding your Steam Deck struggles with heavier emulation loads, that's a hardware ceiling more than a settings problem. A Steam Machine has considerably more CPU and GPU headroom if that's the direction you want to go.