This guide explains to obtain a macOS ISO file and how to create one yourself from an official installer.
Once you have the "Install macOS [Version].app" in your Applications folder, follow these Terminal steps to convert it into a bootable ISO: How to download and install macOS - Apple Support (IN) mac os download iso