Extract HFS+/HFSX volume from dmg file
Solution,
mount dmg file on mac, dump it to img file and extract HFS volume

open [path/to/dmg]
dd if="/dev/disk[number]" of="/extract/path/file.img"


and then on linux I looked up sector size and where HFS volume starts, by:

fdisk -l file.img


Example output:

Disk test.img: 1.3 GiB, 1391718400 bytes, 2718200 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Device      Start     End Sectors   Size Type
test.img1      40  409639  409600   200M EFI System
test.img2  409640 2456015 2046376 999.2M Apple HFS/HFS+


in this example, sector size is 512 bytes and hfs volume starts at 409640th sector and is 2046376 sectors long.

Now extract volume

dd if="path/to/file.img" bs=sector_size skip=sectors count=sectors &gt;&gt; output.hfs