Dragon

The dragons, represented by the overall glyph, are a class of very powerful mid-game monster in NetHack and coveted for the scales they sometimes drop. With some superficial differences, they are nearly identical. Each of them has a nasty breath associated with their resistance. There are also baby dragons, which hatch from eggs.

Each dragon has a specific resistance associated with it. Eating some dragon corpses can give you the associated intrinsics; others can give you the extrinsic ability by enchanting their scales to make dragon scale mail. (Note that dragon corpses are very filling so using a tinning kit is often a good idea.) Baby dragons do not grant intrinsics. Dragons will always leave corpses, and have a 1 in 3 chance of also dropping scales (1 in 20 if the dragon was revived).

The, the Caveman quest nemesis, is a special sort of dragon. Eating its corpse conveys a random resistance.

A shimmering dragon, whose scales grant displacement, appears in the code, but is commented out by default, because monster displacement has not yet been implemented in vanilla NetHack. However, these creatures do appear in SLASH'EM.

Black dragon
A black dragon is the only source of disintegration resistance in the game; this might make acquiring disintegration resistance tricky were it not for the fact that reflection is a reliable defense against the black dragon's disintegration blasts.

Gray dragon
A gray dragon (or baby gray dragon) is often the eventual result of repeatedly displacing your pet onto a polymorph trap, because it is magic resistant, and hence will polymorph no further.

Red dragon
There is a guaranteed red dragon on the Plane of Fire - the only place in the game where a specific color dragon is generated -- not counting Ixoth, the Knight quest nemesis.

Encyclopedia entry
In the West the dragon was the natural enemy of man. Although preferring to live in bleak and desolate regions, whenever it was seen among men it left in its wake a trail of destruction and disease. Yet any attempt to slay this beast was a perilous undertaking. For the dragon's assailant had to contend not only with clouds of sulphurous fumes pouring from its fire breathing nostrils, but also with the thrashings of its tail, the most deadly part of its serpent-like body. [ Mythical Beasts by Deirdre Headon (The Leprechaun Library) ]

"One whom the dragons will speak with," he said, "that is a dragonlord, or at least that is the center of the matter. It's not a trick of mastering the dragons, as most people think. Dragons have no masters.  The question is always the same, with a dragon:  will he talk to you or will he eat you?  If you can count upon his doing the former, and not doing the latter, why then you're a dragonlord." [ The Tombs of Atuan, by Ursula K. Le Guin ]

History
Hack 1.0 has a dragon that does not have an explicit color. This early dragon breathes fire and its corpse confers fire resistance, making it equivalent to the modern red dragon.

NetHack 2.3e introduces all of the modern dragon types except silver. The corpse is still just a "dead dragon", without reference to the color, and eating it confers fire resistance, regardless of the type of dragon. Black dragon breath causes instadeath, and there is no reflection, disintegration resistance, or amulet of life saving, making genocide tempting; but fire resistance is necessary to enter Hell, and there's no way to genocide only black dragons.

NetHack 3.0.0 introduces baby dragons, makes the corpses separate, and also introduces dragon scale mail. Dragon scale mail is obtained by polymorphing a dragon corpse. Reflection is now available and black dragon breath is toned down a bit. It also becomes possible to genocide only black dragons.

NetHack 3.1.0 introduces dragon scales, and with them the modern method of obtaining dragon scale mail. This version also adds the Quests, and with them the Chromatic Dragon and Ixoth. Fire resistance is not necessary to enter Gehennom.

NetHack 3.3.0 adds the silver dragon and corresponding scales.