hdiutil convert /path/to/.dmg -format UDTO -o /path/to/.iso

This sticks a .cdr extension on after the .iso, but I just deleted it.

or if creating from a disk, use Disk Utility and just change the Image Format to “DVD/CD Master”.