It is well-known and well-documented that it's possible to create a bootable USB flash drive allowing you to create an installation media to install or re-install macOS on a Mac. Using the same and native tools, it is also possible to create a bootable ISO image. While you won't be using this very often, it could be handy in several cases (e.g. when running a specific version of macOS in VMware Fusion).
In short, instead of writing to an USB drive, you can create a disk image and write the installer to that image, and then convert it to an ISO image file (technically it's CDR, but in nowadays modern systems they are the same). Subsequently, it is possible to write the ISO to an image (but that would defeat the point of this exercise because you can very well write it directly to the device).
Follow these steps to get the work done:
hdiutil create -o /tmp/macOS -size 8500m -volname macOS -layout SPUD -fs HFS+J
hdiutil attach /tmp/macOS.dmg -noverify -mountpoint /Volumes/macOS
sudo /Applications/Install macOS Catalina.app/Contents/Resources/createinstallmedia --volume /Volumes/macOS --nointeraction
hdiutil detach /volumes/Install macOS Mojave
hdiutil convert /tmp/macOS.dmg -format UDTO -o ~/Desktop/macOS.cdr