that would erase the contents of the destination drive of=/dev/sdg right?
Not quite, it would overwrite the data on the destination drive. There is a subtle difference.
dd works by reading blocks from some where, and then writing them to some where, so you can output to an image file.
As an example, to take a backup of a CD, you could use
dd if=/dev/sr0 of=~/cd_image.iso