Whole drives are referenced without numbers for example: /dev/sda Partitions are referenced with numbers : /dev/sda2
Your example: of=/dev/disk2 references partition 2 on disk.
In many cases the last partition does not use the whole drive and in fact a few MB are left unused. Going past the end of partition 2 could damage partition 3 if the hard drive had a third partition.
The most likely reason it worked is the unused space I mentioned, and the fact you only tried to go 10 sectors over the partition limit and not the hard drive limit. 1MB is 2048 sectors. If you had reached the end of the drive there would be an I/O error.