Apparently there has been a phrase popular enough in the 1950’s as to appear both on a Donald Duck cartoon and an episode of the Andy Griffith show. The exchanged occured when someone had just finished or mostly finished eating an uncut apple and had need to dispense the core in some manner:
Eater: “Apple core!”
Eater: “Who’s your friend?”
Friend1: “Him!” and points to Friend2
Eater: Throws apple core at Friend2
I could easily see how fun it would be as the first to shout Baltimore might grant one the liberty of saying who must be assaulted by mostly-consumed fruit, and even purely at random selection. I would also find it perfectly acceptable to be the target, if I had known the rhyme ahead of time.
It’s been dated as far back as perhaps the 1920s according to this page. A letter was written in the early 1990s of a gentleman recalling some 60 years prior that it had been a common practice in his elementary school days to recite the exchange, putting an approximation of its usage to perhaps the 1920s or 30s depending his age of schooling at the time, as elementary spans over 10 years.
The same page also retracts a remark that the animator for a 1952 Donald Duck cartoon (streamed below) had invented the rhyme for the cartoon after discovering it was used in an illustration of a squaredance call from a book “Melody Time” from 1948.
ChipandDaleOnline.com has a small remark about the above cartoon here and the particular exchange.