No idea about the PS5, but the PS3 controllers couldn't be used on Windows at least. PS4 controllers can be used, they work out of the box (USB only if I remember correctly?) - played lots of Dark Souls 3 with them on my PC.
I've used the PS3 controller on both Linux (out of the box) and Windows. And for the later it was true that I needed to download a separate application, and play a bunch of plug/unplug to get the controller recognized. But once that ritual worked out, I was ready to play.
I used a DS3 and now a DS4 on my Windows PC for years. They work fine once you install a driver (doesn't even have to be third party, Sony released a DS3 Windows driver, but you can only get it by installing Playstation Now).