Pi has the power to do up through PS2 just fine, though last I checked the state of emulation for PS2 and PS3 wasn’t good yet, for the average hacker.
If this is your first time emulating, you’ll have a nicer time learning the ropes on RetroPi on an actual Raspberry Pi. Statistically, you’re not really giving anything up, because anything that doesn’t require insane levels of expertise and esoteric knowledge emulates perfectly on Pi.
Contrarily, is this isn’t your first emulation outing, or you’re down to go all-in down the rabbit hole; then build the whole PC around whatever you find emulates PS3 well, and the rest should be trivial to add.
I second the folks who recommended a Raspberry Pi and RetroPi variant. For no frills, just-start-playing, it can’t be beat.
Another option I haven’t seen mentioned yet, is Ubunutu with Steam. Thanks to the rising popularity of the SteamDeck, lots of great games run perfectly, with no fuss, under Steam on Ubuntu.
But again, with your target including a lot of retro games, a RetroPi is the smooth path. Most of your PS2 games will work fine with some fiddling. Your PS3 experience will be more bound by the current state of PS3 emulation, than by the power of the Raspberry Pi (though you should certainly plan to get the biggest supported model, and get a big cooling kit and overclock it.)
I’ve played various PS2 games with relatively little fuss on an overclocked Pi3 with a cooling kit.
For PS3 era games, I would just make the leap to Ubutnu and then just buy any that are Steam Deck Verified, through the Steam store. Some won’t be, but the ones that are should be a good time.
I, personally, don’t have the life spare cycles to mess with emulating unverified PS3 era games. PS2 era was still very hit and miss last time I bothered for an arcade machine build. I’m sure it’s doable, and might affect your hardware choice. Your best odds are probably Ubuntu, again - thanks to all the investment by Valve.