Problem with dd command
Before doing dd command you need to do unmount $device and sub partitions(if any).

ie, in general

sudo diskutil unmount $device


this case

sudo diskutil unmount /dev/disk2
sudo diskutil unmount /dev/disk2s1
sudo diskutil unmount /dev/disk2s2


then you try dd command, hopes this helps

for reference https://unix.stackexchange.com/questions/271471/running-dd-why-resource-is-busy