In principle, every AirPrint printer model should be compatible with macOS 10.11 El Capitan, if the printer and the computer are connected to the same network (Wi-Fi router). The AirPrint technology as such may work with operating systems as low as Mac OS X 10.7 Lion. However, if you study the specifications for a certain AirPrint model, you may notice higher system requirements. One reason for this could be that the printer manufacturer provides drivers for USB connections, and/or special software, for example, for setup, ink management, and similar purposes.
An HP DeskJet 4155e All-In-One Printer is listed in About AirPrint - Apple Support. An AirPrint model can be used without the installation of additional drivers, provided that the printer and the Mac computer are connected to the same network (Wi-Fi router). In this case, you could perhaps at least carry out a test with AirPrint, using a manual setup. For example, if supported by the router, WPS (Wi-Fi Protected Setup) could be tried for the Wi-Fi connection. "Free" ink subscriptions, et cetera, may not be possible, though. You would have to check the details in any agreement in connection with the purchase, if applicable.
If necessary, it may be possible to upgrade the operating system on this iMac. Sometimes, macOS 10.14 Mojave or higher is required for setup apps from a printer manufacturer.