"Yankee Doodle" first appeared during the French and Indian War. British troops would sing it to make fun of the Americans fighting with them. Let's break down the words.
Yankee - A derogatory word used by the Dutch in New Amsterdam (New York) way back in the late 17th century for English colonists. Probably from the Dutch word Janke, "little John." In the 18th century British troops would demean Americans by calling them "Yankees" in the same way US soldiers used to call all Koreans and Vietnamese "gooks" and currently call all Arabs "haji."
Doodle - a slang word for "penis." Also meaning dolt.
Riding on a pony - Men ride horses. Children ride ponies.
Stuck a feather in his hat and called it macaroni - If you're like I was, you couldn't figure out how a feather was like cheese covered pasta. Macaroni in 18th century England was a fad where men wore make-up, outlandish wigs and clothes, and walked and talked in an exceptionally effeminate fashion. RuPaul is Macaroni.
So, to translate the song into modern understanding:
An American dickhead came to town
Riding a tricycle
He stuck a feather in his hat
And called it "simply fabulous!!!"