A dud is an ammunition round or explosive that fails to fire or detonate, respectively, on time or on command. Poorly designed devices (for example, improvised explosive devices (IEDs)), and small devices, have higher chances of being duds.
Duds are still dangerous, and can explode if handled. They have to be deactivated and disposed of carefully. In wartorn areas, many curious children have been injured or killed from tampering with such devices.
The term descends from the Middle English dudde, originally meaning worn-out or ragged clothing, and is a cognate of duds (i.e., "clothing") and dowdy. Eventually dud became a general pejorative for something useless, including ammunition.
The variation absolute dud describes a nuclear weapon that fails to explode. (A nuclear weapon which does explode, but does not achieve its expected power, is termed a fizzle).
By extension, "dud" has become a slang word for anything that does not work or is defective. There is also a candy called Milk Duds, so named because it was impossible to get them perfectly round.
Other meanings
Generally your duds are "your last possessions", what you are wearing and carrying, so nice duds is ironic and possibly an oxymoron. Other meanings of 'dud' are: