Given this was an invention for the films the scene must be taken with a pinch of salt. The original occurrence in the book, that firework was let off by Gandalf specifically for Bilbo and signalled the beginning of supper:
And there was also one last surprise, in honour of Bilbo ... The dragon passed like an express train, turned a somersault, and burst over Bywater with a deafening explosion.
‘That is the signal for supper!’ said Bilbo.
Fellowship of the Ring, Book I, Chapter 1: A Long-Expected Party
The quote from the films, or anything of the like is never mentioned in the books and the only mention of Dragons in the Shire is "The Green Dragon" inn, the only dragon in Bywater.
From this answer we know of only 4 named dragons: Glarung, Ancalagon, Scatha and Smaug. Of those we don't have much reason to believe it was Smaug that was spotted in or around the Shire.
Glarung remained mostly in West Beleriand and would've been unlikely to have been one mentioned by Bilbo, even though he had at times ventured close to the Ered Luin reaching the arms of Gelion.
Ancalagon doesn't have much written about him, although we know he was finally thrown down on Thangorodrim, which again is not near to the Shire.
Finally, Scatha, the most likely culprit, was slain in ca. Third Age 2000 by Fram of the Éothéod; the ancestors of the Rohirrim. Although like the others, Scatha was located around the Grey Mountains and therefore quite far from the Shire.
As such it would seem this was a movie invention, and while there have been many dragons and some may have ventured into or flown over the Shire, there is no mention of them made. As Ted Sandyman says "There’s only one Dragon in Bywater, and that’s Green" (ibid, Chapter 2: The Shadow of the Past)