I haven't used the "hdiutil" or "diskutil" or other macOS specific commands very often and only in the most basic ways. This is not easy to describe because so much depends on the actual error messages you may receive. Plus I'm not real familiar with the macOS utilities so I would need to do a lot of research and experimentation to do more than provide the basics to get you started and point you in the right direction:
You use "hdiutil" to "attach" an image file so that macOS utilities can manipulate the image contents. Using the Terminal app type the following making sure to leave at least one space at the end of the line:
hdiutil attach
Now drag & drop your .dmg file from the Finder onto the Terminal window to auto-fill the correct path to your .dmg file. Then within the Terminal app press the "Return" key to execute the command. If successful you may try to mount it read only.
To try and mount the attached .dmg using the command line I think it is easiest to use "diskutil" since the "mount" command needs to be provided a lot more information.
diskutil mount readonly <path-to-attached-dmg-file>
or if you know the disk identifier for the attached .dmg file (replace the "diskXsY" with the correct drive identifier for your attached volume):
diskutil mount readonly diskXsY
If the file system within the .dmg is damaged you may be able to run "fsck" on it to repair the file system contained in the .dmg file assuming it is a writable image. If it is not a writable image, then you need to convert it to a read+write image.
If the image is writable you can try repairing its file system using "fsck". If you can find the path or identifier for the attached .dmg file add it to the following command in place of "<path-to-attached-dmg-file>":
sudo fsck <path-to-attached-dmg-file>
Or use the disk identifier if known (again replacing "diskXsY" in the example):
sudo fsck /dev/diskXsY
Also "hdiutil attach" has a lot of options which may help you. You can review the command options of any command by typing "man " followed by the name of the command you want help with. For example to find out which options are available for "hdiutil" you would do this:
man hdiutil
Use the arrow keys or the mouse/trackpad to scroll up & down. To exit the "man page" just press "q".
I don't know if the paid app Disk Warrior would be able to work on a .dmg file or not. The image would need to be in a read+write format though.
Another option would be trying to using Linux and the Linux command line tools to access these .dmg files. It is possible they may be able to work around some minor issues. Linux typically is more forgiving when trying to open damaged items. I do know that the .dmg files will first need to be converted to a standard raw image format using the Linux utility "dmg2img". Then you would use "losetup" which is the Linux equivalent of "hdiutil" to access any partitions within the image before mounting it. Linux also has access to TestDisk.
I've only presented the very basics here. Basically a .dmg file is just a raw image file usually containing a file system whose contents are compressed. Except for being contained in a file you can almost think of it like an external drive if that helps. While I've done similar things on Linux a few times over the years it is not second nature to me yet and I will sometimes need to Google how to perform some of these steps myself. Just make sure to work from a copy of the .dmg file so you always have the original file in its original state. Also macOS can get stuck when attaching, detaching, mounting, and unmounting volumes and virtual volumes. Many times I will see the Finder showing volumes which I unmounted. If you see these phantom/ghost volumes, then you may find that you need to reboot the computer to get Finder and Disk Utility to act normal again.
If this is overwhelming and you don't have the time which is perfectly understandable, then I suggest contacting a professional data recovery service and get an estimate. Unfortunately most technical computer users are not familiar with these procedures and trying to find good & accurate information on it for macOS is extremely difficult. There isn't even a whole lot of information for doing this on Linux either.
Good luck.