tar.gz to dmg conversion can mean two things, either just pure extraction of the content in which case you will need file archiver that supports TAR.GZ format.
The other possible way to look at this is repacking of the content from TAR.GZ to make a disk image in macOS DMG format, for which you will need appropriate tool to handle it.
Updated: September 28, 2023