Hi,
An AirPrint-compatible printer should work with earlier operating systems (sometimes as low as Mac OS X 10.7 Lion), but a printer manufacturer could provide extra software (necessary or not) for printing, setup, ink management or similar purposes with higher requirements.
HP Smart for Desktop (https://apps.apple.com/us/app/hp-smart-for-desktop/id1474276998?mt=12) appears to need macOS 11 Big Sur.
The HP LaserJet MFP M140w is listed in About AirPrint - Apple Support (December 20, 2023) as a model supporting Apple's AirPrint technology. Since AirPrint per se would not need additional drivers, and should work if a printer and a Mac computer are connected to the same network (Wi-Fi router), you may want to carry out an experiment with macOS 10.13 High Sierra even without confirmed compatibility. It may or may not work well (possibly with limitations) in this case.
If necessary, you could perhaps check whether setup and ink management operations could be performed via an HP Smart app on an iPad or iPhone (instead of doing this on the Mac, thus maybe allowing macOS 10.13 High Sierra use otherwise).
https://apps.apple.com/us/app/hp-smart/id469284907
https://support.hp.com/us-en/product/product-specs/hp/30190589