It was in Baghdad is the first line to one of the many various lyrics children have invented to fit the Streets of Cairo tune, the most famous of these being There is a place in France. It is a surprisingly well-known intro, given that no one remembers much more than the first couplet.
"It was in Baghdad,
Where me Mammy met my dad,
He was in the Foreign Legion at the time."
The first line only differs in how one spells 'Baghdad'. The second line is also pretty standard; it's always some version of "where my mother met my dad." After that, it goes very fuzzy. It appears that, insofar a full song actually ever existed, it referenced the foreign legion.
"It was in Bagdad,
Where me mother met me dad,
It was in the foreign legion
Where they did a dirty treason,
With her long black hair
And her ti**ies hanging there,
Singing, Nelly put yer belly next to mine."
'Nelly put your belly next to mine' is often the third line of this song, but in that case it is also the last line. It is usually the only other line that those who heard it as a kid can recall, often reporting that that's all they had ever heard. This lyric appears in a lot of dirty songs, and may be a floater; songs of this sorts trade lyrics all the time.
Those snippets listed above are the only two substantial attempts to document the lyrics that currently exist on the internet. That's it. There are pages and pages of There is a place in France lyrics and These Foolish Things and Miss Lucy had a Steamboat and hundreds of other of these unofficial and endlessly mutating songs. So maybe this isn't really a song, per se, but a lyrical meme.
Moreover, the first time I heard it was as a throw-away line in an Aladdin panto; the genie sang only the first two lines, as a non-naughty reference to a naughty song. Maybe there isn't really any more too it.
Although there is not much evidence to support it, it may also very well be that it is simply an alternate start to There is a place in France, as it is sung to the same tune. Consider this (admittedly singular) version of that song:
"There's a place in France
Where the naked ladies dance
It was in the Foreign Legion in a very sexy season
With her long blonde hair
And her boobies hanging there
She said 'Will you rub your belly next to mine?'"
And that's all I have. If you remember singing this as a kid (or an adult, I guess), let me know, and I'll add your lyrics here. If you remember more than seven lines, you are the world expert.