In the original Transformers cartoon, Grimlock and the Dinobots are created by Wheeljack and Ratchet after volcanic activity unearthed prehistoric fossils near the Autobot base. High Moon Studios' explanation for the Dinobots appearance in Transformers: Fall of Cybertron makes a whole lot more sense.
The Dinobots' Fall of Cybertron origin borrows elements from several different continuities' versions of the powerful group. Marvel Comics established the Dinobots as a crack team of commandos led by Grimlock. Dreamwave Comics had the team transforming into Cybertronian tanks, which made more sense. Devil's Due Publishing had the Dinobots travel back in time to prehistoric Earth, where they acquired new forms.
A running theme across almost all of these continuities (including the most recent IDW comics) is the Dinobots' strong hatred of Decepticon mad scientist Shockwave.
High Moon's origin of the Dinobots mixes together elements from all of these stories. The Dinobots are an elite Autobot strike force. Shockwave captures them and experiments on them, sacrificing their intelligence in order to give them powerful bodies based on the creatures he studied through a space bridge to prehistoric Earth.
The Dinobots rebel against their re-creator, and the rest is fictional history.
It's a bit of a hodge-podge, but at least we've got a solid answer for anyone that dare question Grimlock's existence.