In the setting of Middle-Earth, the origins of Dragons are ambiguous, but it is known that they were created by Morgoth in some way (likely by corrupting a pre-existing race as he did with the Balrogs). Alongside the Balrogs, Dragons were among Morgoth's greatest servants, but they were mostly wiped out during the epic battles of the First Age, including their greatest representatives, Ancalagon the Black and Glaurung.
However, some Dragons did manage to escape and retreated to different corners of Middle-Earth, where they persisted in tormenting and terrorizing Middle-Earth's denizens until the good people fought back, steadily reducing their numbers until it was believed that only one dragon remained (Smaug). His death at the hands of Bard the Bowman marked the apparent extinction of the Dragon race.
However, if the prophesied Dagor Dagorath occurs, it can be assumed that the Dragons, like Morgoth's other creations, will return to aid their master in the great final battle between the forces of evil and good.