Since that version of the nursery rhyme is Irish, I would hazard a guess that Derry-O refers to either the city of Derry, or it's a reference to an Irish boy (Derry being a traditional Irish boy's name).
Versions of this nursery rhyme from the UK used different things for Derry, like London, which makes me believe it refers to Derry the city.