While I haven't tried installing Windows 98 in VMWare in a long time, the Win98 VM I set up years ago (and several computers back) mostly works on my Ryzen 5900X (there's an error from RUNDLL about powrprof.dll on startup, and Explorer randomly doesn't show any contents). OTOH, Windows 95 VM won't start due to a known problem with Windows 95 and very fast machines (however it does run if I restore a snapshot where it was running while the snapshot was taken).
You might have more luck running these ancient OSes on an emulator, such as 86box.