Is mac sierra protecting me from erasing my hard drive and my sd card when I was trying to erase my sd card in fat16 format i entered the wrong device tree .(e.g. instead of writing disk3s2 i wrote disk2 when i executed the command it said permission denied(which was supposed to erase my whole drive).then when i again tried to format it the right way it again said permission denied.

newfs_msdos -F 16 /Volumes/KIRAN\ USB/dev/disk2s1


So here's my question why am I not able to format my drive and sd card via terminal
Only the super user can normally perform this action, except when using the diskutil command, which incorrectly allows it. The full command you should use would be sudo newfs_msdos -F 16 /dev/disk2s1. You will have to enter your password to continue. Although, I would suggest using FAT32, because FAT16 is likely inappropriate for your SD card assuming you bought it sometime in the past decade. An even better option would be exFAT, assuming all the devices you'll be using this SD card in support it.