The dwarves said there was no way into the mountain before Gandalf gave Thorin the key... in the movie. So I was wondering, how did Smaug get out to eat?
In the book, as well as the movie, there was a main entrance to Erebor—the Front Gate, where the dragon had come in to begin with. When the dwarves first discuss the mission with Bilbo, Thorin mentions that they had considered getting in this way;
But we none of us liked the idea of the Front Gate. The river runs right out of it through the great cliff at the South of the Mountain, and out of it comes the dragon too—far too often, unless he has changed.
The Hobbit, Chapter 1: "An Unexpected Party"; emphasis added
Later, as the party is scouting the mountain, Balin mentions the possibility that Smaug might in fact be out and about at that moment:
"The dragon is still alive and in the halls under the Mountain then—or I imagine so from the smoke," said the hobbit.
"That does not prove it," said Balin, "though I don't doubt you are right. But he might be gone away some time, or he might be lying out on the mountain-side keeping watch, and still I expect smokes and steams would come out of the gates: all the halls within must be filled with his foul reek."
The Hobbit, Chapter 11: "On The Doorstep"
When the dwarves say that there is no way in, then, they don't mean that there is literally no entrance or exit, but that there is none safe for them.