The word "dinosaur" wasn't coined until 1842, but fossilized bones of extinct creatures have been encountered for as long as humans have been digging in the ground. Those who found them would ascribe their origin to whatever they could relate to, such as dragons or giants. Which leads us to a chicken-or-egg question: did the legends come from the fossils, or were the fossils just further evidence of the legends? However, the science of paleontology inched forward over time, with some wonderful stories along the way, like that of the first Megalosaurus bones that were seriously studied.
But before it was called the Megalosaurus, it had a rather more humorous name. You see, in 1763 a physician called Richard Brookes studying Plot’s drawings dubbed it “Scrotum Humanum” because he thought it looked like a set of petrified testicles. (To be clear, Brookes knew it wasn’t a fossil of a giant scrotum, but nevertheless decided to name it thus because apparently men of all eras of human history can’t help but make genital jokes at every opportunity.)
While hilarious, in the 20th century, this posed a problem for the International Commission for Zoological Nomenclature when it eventually came time to formally classify the Megalosaurus as such. The problem was, of course, that Brookes had named it first.
Eventually the ICZN decided that since nobody after Brookes had called it Scrotum Humanum, even though he was the first to name it, that name could safely be deemed invalid. Thus Megalosaurus won out, which is unfortunate because discussion of the rather large Scrotum Humanum would have provided great companion jokes to ones about Uranus in science classes the world over.
Read about how the science of dinosaurs developed at Today I Found Out.