HP 5.1.1 Printer Software Update - Apple Support
Earlier reports indicate that an HP LaserJet 1022 driver from this package can be used with an HP LaserJet 1020 printer as well, thus making the latter model compatible with Mac. However, it says Not compatible with macOS v12 and newer for the package in question. The problem seems to be that the installation is prevented under newer macOS versions, while the underlying driver as such appears to be OK. You could perhaps have a look at some package modifications suggested (try a community search for LaserJet 1020 or P1005 with a Last year filter), but the success rate is somewhat unclear.
Linux drivers are available.
https://developers.hp.com/hp-linux-imaging-and-printing/supported_devices/index
If nothing else helps, you may want to investigate whether a small and relatively inexpensive Linux-based Raspberry Pi print server and CUPS could make a USB-connected HP LaserJet 1020 act as if it were an AirPrint printer, in order to allow network printing from a modern Mac or iPhone/iPad (an AirPrint printer can be used without additional drivers/software). Look upon this as an experiment.
Details about how to set up such a Raspberry Pi print server can be found in the posts by Techguyuk in Can’t print with iPadOS17 - Apple Community.
Tesserax reported about using a Raspberry Pi 3 Model B+ for an old HP LaserJet printer (in Can I connect my laser printer to my netw… - Apple Community).