Any problems running DOS games on the DOS version under Windows 98 are most likely due to something other than Windows 98, like drivers or sound card incompatibility or excess processor speed.
Most of the Compaq Deskpros I see on eBay are Pentium III models without any ISA slots on the motherboard and wouldn't make great DOS game machines. I also can't find any indication there were sound drivers for DOS using the default onboard sound. You might be able to find a PCI sound card that had DOS drivers, install that, and disable the onboard sound.
I haven't found working links for driver downloads from the web archive of the Compaq website, but I've found lists of drivers (Compaq included them in what they called "Softpaqs") and descriptions of different Deskpro computers.***Compaq Deskpro EN small form factor (SFF) series from 2000******Compaq Deskpro EN small form factor from 2001******List of Softpaqs from 2000******List of Softpaqs from 2001******List of Softpaqs from 2002***
Since none of the driver links on those webpages work, these lists only describe what model Deskpros the drivers were for, which might help identify the name to search for using Google. You might find downloads for them at driverguide or somewhere. Some Softpaq descriptions say they're for Windows 95, but I haven't seen any DOS drivers for sound listed.
A Compaq Deskpro EN SFF might work with early Windows games. If the game is speed-sensitive and the processor is too fast, you could try using a PC-slowdown program like Turbo or MoSlo.
If the computer has USB ports and you want to use them, you're better off with Windows 98. Though there were USB drivers made for Windows 95, many people had problems with them and USB support is better in Windows 98.
You're more likely to find a game that's incompatible with a newer DirectX version than find a Windows 95 game that won't work with Windows 98. For example, Armed and Delirious wanted DirectX 5 and wouldn't work with DirectX 7. I don't know if it worked with DirectX 6.
Anyway, locating Windows 95 drivers for a Compaq Deskpro EN SFF would be a challenge, even for someone who used to service them back in the early 2000's. You could probably install Windows 95 on it, but you'd be left with 16-color graphics in 640x480 and no sound unless you could find the right drivers for your model. It's not a challenge I would want to take on.
There are older Compaq Deskpros that could be made to work with Windows 95 -- for example the Deskpro 6266 that was renovated in this threadhttps://www.vogons.org/viewtopic.php?f=46&t=56785
You can read about some of the hurdles he had to overcome to get his Deskpro 6266 working, though in the end he was able to get it the way he wanted and was satisfied with the result.
But I'm not finding anything called "Compaq Deskpro EN SFF" that isn't a Pentium III with the "challenges" I've described above.
If you decide you want to try putting Windows 95 on it anyway, I'd suggest swapping out the hard drive with an empty hard drive first -- so you don't overwrite a working configuration, and can put the original hard drive back in if you can't get Windows 95 with necessary drivers installed.