Is data in an APFS container erased after main partition is reformatted?
When Mojave is installed, you need to choose a APFS volume. However, the operating system is not just installed to this volume. Additionally, three other hidden APFS volumes (Preboot, Recovery and VM) are created, if they do not already exist. The preboot files are placed in a folder in the Preboot APFS volume and the recovery files are place in a folder in the Recovery APFS volume. In both cases, the name of the folder is the same as the UUID assigned to the APFS volume you chose when installing Mojave. The VM volume is used to store the sleep image and the swap file.

If you create a new APFS volume and install Mojave to this volume, then the three hidden volumes are reused. Again the preboot and recovery files are placed in a folders with a name the same as the UUID of the new APFS volume.

If you delete a APFS volume that was chosen for a Mojave installation, only this volume is removed. The three hidden volumes remain and still contain and the same files. To remove the folders containing the preboot and recovery files, you have to manually mount the volumes and remove the folders. (For example, use the diskutil mount command to manually mount each volume.) Since the space taken up by these folders and their contents is fairly small, most users will probably elect to just leave the folders intact on these hidden volumes.


  This is a long way of saying: The removal of Mojave by deleting a APFS volume does not alter any other APFS volumes.


What I wrote above also applies to High Sierra when installing to a APFS volume.