The nickname is about 100 years old and does not reflect present-day Bagdad (Iraq). Unfortunately, should a subway incident occur, expect this nickname to re-surface in a new context.
"Bagdad-on-the-subway" (sometimes spelled "Baghdad") is in several of his stories, such as "What you want" in Strictly Business: More Stories of the Four Million (1910).
Wikipedia: O. Henry
O. Henry was the pen name of William Sydney Porter (September 11, 1862 — June 5, 1910), whose clever use of twist endings in his stories popularized the term "O. Henry Ending."
O. Henry was released from prison in Columbus, Ohio on July 24, 1901 after serving three years for embezzlement from a bank. On release he settled in New York City and began his writing career.
It is believed that Porter found his pen name while in jail, where one of the guards was named Orrin Henry. Other sources say that the name was derived from his calling "Oh Henry!" after the family cat, Henry.
His stories are famous for their surprise endings and ironic coincidences, but do not lose their interest after the surprise is known. His best are full of genial warmth and wistful sadness. The great ones, such as "The Gift of the Magi", "The Last Leaf", "The Skylight Room". "Springtime a la Carte", "The Third Ingredient", and "The Green Door" seem to get better with repeated rereadings.
Most of his stories are set in his contemporary present, the early years of the 20th century. Many take place in New York, notably those in The Four Million (a reference to the population of New York at that time). O. Henry had an obvious affection for the city, which he called "Bagdad-on-the-Subway." But others are set in small towns and in other cities. His famous story A Municipal Report opens by quoting Frank Harris: "Fancy a novel about Chicago or Buffalo, let us say, or Nashville, Tennessee! There are just three big cities in the United States that are 'story cities'—New York, of course, New Orleans, and, best of the lot, San Francisco." Thumbing his nose at Harris, O. Henry sets the story in Nashville.
His stories deal for the most part with ordinary people: clerks, policemen, waitresses. He opens The Four Million by observing that "Some one invented the assertion that there were only 'Four Hundred' people in New York City who were really worth noticing. But a wiser man has arisen—the census taker—and his larger estimate of human interest has been preferred in marking out the field of these little stories of the 'Four Million.'"
3 April 1910, Chicago (IL) Daily Tribune, pg. E10:
Discounters of Money.
By O. HENRY.
THE spectacle of money caliphs of the present day going about Bagdad-on-the-Subway trying to relieve the wants of the people is enough to make the great Al Raschid turn Haroun in his grave.
11 April 1910, Fitchburg (MA) Daily Sentinel, pg.11, col. 3:
Sights and Nights in Bagdad-on-the-Subway
It is typical of O. Henry writing. 'Nough said. Further commendation is futile, higher commendation is unnecessary.
(The latest collection of O. Henry stories - ed.)
15 April 1925, Fitchburg (MA) Daily Sentinel, pg. 6, col. 4:
Above the electric lights streak and blink and whirl in a refulgent glory. And under foot they dance along in fantastic pattern. Alice in a wonderland of a thousand mirrors. Bagdad on the Hudson, Swarming on a magic carpet.
6 February 1927, Los Angeles (CA) Times, pg. A7:
He has secured Hornsby, Harper Grimes, DeVormer and about a dozen outfielders, and there is a lot of talk in Bagdad-on-the-Hudson about another pennant for the Polo Grounds.