Before starting:
This was tested on a MacBook Pro 2019. I cannot confirm if this method works on another machines. Also, I do not take ANY responsibility if something happens to your Mac. If you do this like im telling you to, it should work as expected.
- Install MacOS WITHOUT ANY CONNECTION TO THE INTERNET (If the router can be turned off, please do). You can get more information on how to do this in the Apple support page: support.apple.com/en-us/102662 I performed my tests using Monterrey, since (I think) that's the OS that it came with the machine.
- Once the main installation is finished and it starts asking you for configurations, you should note that It does skip the enrollment part, once you're in the desktop. You can re-activate the internet.