(Pterodactyl.)
I think the form of the dragon was pioneered with other imaginary creatures. In the middle ages, dragons weren't as standardised as they are now, often described as 'worms', and coexisted in the imagination with other hexapods like griffins. In turn, I think the simurgh of ancient Babylon might be the earliest recorded example of a hexapod.
The simurgh is a lion or horse or something with wings and a human head. I guess someone was sitting around inventing writing and irrigation, when the geeks of Babylon tried to come up with the coolest thing possible, and just put wings and wisdom on some normal creature without stopping to count. Like a monkey-pirate-robot amalgam today, only they took it seriously. (Nor did they have monkeys, pirates, or robots at the time.)