I wonder if there is a way to sort of "unroll" a dmg file and reveal which directories it will install files to?
A DMG (Disk Image) file is like a zip file. It's compressed and has a check built-in to check if the integrity of the app is intact. Once you open a DMG file, in most cases, you just have to drag/drop the application into you Applications folder and that's it. If you want to see the full content of that application, go to Applications folder Right click on an app Select 'Show the ... content' In the 'Contents' directory, you'll see all dirs and files that came with your app. I don't know if that's the answer your are looking for?
DMG refers to a Disk Image. When you open a DMG, nothing happens–it's like opening a folder (effectively, there are some differences but none that affect the answer to this question).
Typically, you're asked to drag the application to the Applications folder. This is exactly as it appears–the file you're dragging (the application) is being copied to the Applications folder.
Sometimes, you're asked to open an installer. The specifics of how the installer works varies based on how the developer wrote it. The DMG portion of the process doesn't really effect that.
The standard is a PKG file, which opens the standard installer program. This has you go through a few steps, with an outline on the left side of the screen. These files can be analyzed. I've found an article online (but have not tested it) here.