I spent a lots of time figuring out how to setup Hp Printers with MAC M1. I could setup atleast my Hp Deskjet 2331 All in one printer.
Here are the steps I followed.
Download drivers from https://support.apple.com/en-in/106385
Open iTerm and type following commands:
$ mkdir hp
$ cd hp
$ mv ~/Downloads/HewlettPackardPrinterDrivers.dmg .
$ hdiutil attach HewlettPackardPrinterDrivers.dmg
$ mkdir hp
$ pkgutil --expand /Volumes/HP_PrinterSupportManual/HewlettPackardPrinterDrivers.pkg ./hp/hp
$ hdiutil eject /Volumes/HP_PrinterSupportManual
$ sed -i '' 's/15.0/16.0/' ./hp/hp/Distribution
$pkgutil --flatten ./hp//hp ./HP_Drivers_12.pkg
Go to Downloads/hp folder and double click on HP_Drivers_12.pkg and install
Go to system settings ->printers & Scanners -> add printer, select your printer.
From the 'Use' drop down, choose 'select a software', And type 'All in One', select 1st printer or whichever is in your series.
Open a text editor, print a test page.
Download vuescan from https://www.hamrick.com/download.html?dl=1 and install.
Open vuescan, choose your printer and scan a test page.