.app is like .exe, but .dmg is a disk image, not an installer. If you double-click a disk image it will be mounted on the desktop like any other readable device. There may be an option to have an application (possibly an installer) run automatically upon mounting a disk image, but that's not the norm.