Way back in 1933, the Sinclair Oil Corporation sponsored a dinosaur exhibit at the World's Fair in Chicago, on the premise that the world's oil reserves were formed during the Mesozoic Era, when the dinosaurs lived. The exhibit was so popular that Sinclair promptly adopted a big, green Brontosaurus (today we'd call it an Apatosaurus) as its official mascot. Even as late as 1964, when scientists were starting to know better, Sinclair repeated this trick at the much bigger New York World's Fair, driving home the connection between dinosaurs and oil to an entire generation of impressionable baby boomers.
Today, Sinclair Oil has pretty much gone extinct in the popular imagination (the company has been acquired, and its divisions spun off, a couple of times over the last few decades, though there are still a few thousand Sinclair Oil gas stations in the American midwest). The premise that oil originated from dinosaurs has been harder to shake, though; politicians, journalists, and even the occasional scientist have been prone to this delusion. Which prompts the question: Where does oil really come from?
Oil Was Formed by Tiny Bacteria, not Huge Dinosaurs
You may be surprised to learn that--according to the best theories currently available-- microscopic bacteria, and not house-sized dinosaurs, produced today's oil reserves. Single-celled bacteria evolved in the earth's oceans about three billion years ago, and were pretty much the only life form on the planet until about 600 million years ago. As tiny as the individual bacteria were, bacterial colonies, or "mats," grew to truly massive proportions (we're talking thousands, or even millions, of tons for an extended bacterial colony, compared to 100 tons or so for the biggest dinosaurs, the sauropods).
Of course, bacteria don't live forever. As members of these massive colonies died off, they sunk to the bottom of the sea and were gradually covered by accumulating sediments. Over the ensuing millions of years, these layers of sediment grew heavier and heavier, until the dead bacteria trapped beneath were "cooked" by the pressure and temperature into a stew of liquid hydrocarbons. This is the reason the biggest oil reserves are located thousands of feet underground, and not readily available on the surface in the form of lakes or rivers.
Okay, Forget Oil--Does Coal Come from Dinosaurs?
In a way, it's closer to the mark to say that coal, rather than oil, comes from dinosaurs--but you'd still be dead wrong. Most of the world's coal deposits were laid down during the Carboniferous period, about 300 million years ago--which was still only 75 million or so years before the evolution of the first dinosaurs. During the Carboniferous, the earth was blanketed by dense jungles and forests; as these plants and trees died, they were buried beneath layers of sediment, but their unique chemical structure caused them to be "cooked" into solid coal rather than liquid oil.
There is an asterisk here, though. It's not inconceivable that some dinosaurs perished in conditions that lent themselves to the formation of fossil fuels--so, in fact, a small proportion of the world's oil, coal and natural gas reserves can be attributed to rotting dinosaur carcasses. You just have to bear in mind that the contribution of dinosaurs (or any other vertebrate animals, such as fish and birds) is orders of magnitude less than that of bacteria and plants. In terms of "biomass"--that is, the total weight of all the organisms that have ever existed on earth--bacteria and plants are the true heavyweights; all other forms of life amount to rounding errors.
Dinosaur Fossils Are Sometimes Discovered Near Oil Deposits
That's all well and good, you might object--but how do you account for all the dinosaurs (and other prehistoric vertebrates) that have been discovered by work crews searching for oil and natural gas? For example, the well-preserved fossils of plesiosaurs have been found near Canadian oil deposits, and a theropod dinosaur accidentally discovered during a fossil-fuel drilling expedition in China has been given the well-deserved name Gasosaurus.
There are two ways to answer this. First, the carcass of any animal that has been compressed into oil, coal or natural gas wouldn't leave any fossil at all; it would be entirely converted into fuel. And second, if a dinosaur fossil happens to be discovered in the rocks atop an oil or coal field, that means the unfortunate creature met its end tens of millions of years after that field was formed; the precise interval can be determined by the fossil's relative location in the geologic sediments.