Baghdad was a city on Earth.
According to the Eleventh Doctor, it was "one of the shining centres of Middle Eastern cultures, the city of one thousand and one nights". In 1930, he and Clara Oswald visited the city to see Omar, a fez dealer. (COMIC: A Wing and a Prayer)
Bernice Summerfield visited Baghdad in the 8th century. (PROSE: The Judgement of Solomon)
While being pursued by Cat-People, the Second Doctor and his companions, Ben and Polly, arrived in Baghdad. (PROSE: Invasion of the Cat-People)
While being rapidly transported through the Dalek Hive, the Eighth Doctor said he hadn't felt so travel-sick since he flew by magic carpet in old Baghdad. (COMIC: Fire and Brimstone)