Some clarification may help. Most of what you get in a flash is an image which is from the rootfs sudirectory being copied into a loopback mounted ext4 file system. The arguments you pass to the flash.sh script (or the equivalent from JetPack) will also copy some device tree and boot related content. The result is that if you were to make changes in the “/boot” partition of the rootfs these would probably not be honored…but most everything else would.
There are some binary images which are copied in as well, but these are more or less “stock” and not built on the fly. Examples would be the U-Boot binary and the device tree for R28.1 or newer. The device tree may itself be chosen from a set of preexisting images, and that choice based on flash arguments, but those images are not created dynamically…they already exist. For example, if you wanted to change the device tree in these newer releases you would copy your modified version of the binary to the correct place overwriting the source of that image…and it is during flash this modified version would go into some partition of the eMMC. Change the pre-existing image for these non-rootfs images, and if the arguments passed say to use those images, then those images will always be used from your custom version.
In terms of the actual rootfs, this is the “bootloader/system.img.raw” down to the last bit. If you use the “-r” option to flash.sh, then this gets re-used, and if you have edited this, then your exact edits (even for “/boot”) will always get used. There is a detail though…the file used to flash with when re-using is “system.img”. You will see the larger uncompressed/raw image “system.img.raw”, plus the more or less compressed “system.img”. The flash always uses the “system.img”, but doesn’t care if it is raw or sparse…you could delete the sparse system.img, change the name of “system.img.raw” to “system.img”, and this would be used (though the flash would take longer).
The reason to use the uncompressed version is that it can be loopback mounted, edited, updated through rsync, or anything else you might want to do with a backup of a system. The original “sparse” (compressed) version cannot be used for anything but flashing. This use of a raw image is often the way to go if you want your rootfs customized and test deployed and such since you can verify and edit it over time. If you want the device tree or other images replaced, then you would do similar with those images.