Trying to program nanites would, to say the least, be a bit of a challenge. The original idea for giving nanites their instructions was to transmit a program by using broadcast communications. This would enable the nanorobots to be easily controlled and, if things got out of hand, the transmitter could just be turned off. This is the programming code of every living thing, including us, and it seems to work fine. In all technology, there is room for misuse.
Nanotechnology has the potential for a lot of serious misuse.
The sinister applications of nanotechnology are as near as your dreams or rather, your nightmares. If you are dealing with something like nanorobots the product of several scientific disciplines over which no single country has a monopoly it will be almost impossible for any country or world body to control or prohibit the development of nanoweapons. Given the proper materials and instructions, nanorobots can build almost anything. Give them instructions to destroy something, and they will do it with just as much efficiency. At this point it is rather doubtful, no matter how sinister the application.