Save this as dmg2iso and run from the terminal:

#!/bin/bash

if [ -z "${1}" ]; then
    echo "Usage: ${0##*/} <file>"
    exit 1
fi

FILE=${1%.dmg}
hdiutil makehybrid ${FILE}.dmg -o ${FILE}