If I make a bootable pendrive running macOS, will downloaded apps and data persist on each boot?
The createinstallmedia command creates a startup disk whose purpose is installing MacOS onto another drive.
If you just want to install MacOS onto a USB thumb drive, then just run the OS installer app and select the drive as the target. (It will present you with the current system volume by default, but there's an &quot;Other Volumes&quot; button.)
Once you've installed the OS onto your USB drive, yes, it will be a read-write volume, so things will get saved there and stay there. (Though remember to keep a backup as thumb drives can fail suddenly.)
An alternative strategy might be to host Mojave inside a Virtual Machine (VM), which is &quot;an OS as an app&quot;. So you launch the VM and Mojave runs in a window, inside your Catalina (or later) OS! Parallels or VirtualBox are the two main VMs.