I recently replied to a person named Virginia on the IGP Dublin Facebook page about this same person - unfortunately without further details such as names of parents or siblings or a more detailed place of birth e.g. parish, it's going to be difficult to locate a good possible match for 'your' John Gallager or his family.
John was born well before the start of civil records, i.e. birth certs, so a search of Church Baptism records would be required. Many of the records for the Catholic and Church of Ireland city parishes are available as images & searchable transcripts on the free IrishGenealogy website, which also has some records for Catholic parishes in the south east of the county. The National Library of Ireland has images of most of the Catholic Parishes in Ireland, and these are searchable on FindMyPast and Ancestry.
A search of Catholic registers covering Dublin city & county showed a number of John Gallagher baptisms (assuming your John was RC) in Dublin city and county around that time. Ages were not always reported accurately in later documents, so its best to allow at least 5 years either way when searching.
John Galagher bapt. Feb 1843 St. Catherine's RC, parents James & Ellen
John Galagher, bapt. Oct 1845, St. Nicholas RC (Francis St.) parents James Galagher & Mary Kearns
John Galaher bapt. Feb 1844, St Paul's RC parents James Galaher & Ann Lamb
There were no promising matches for John in the Church of Ireland records for Dublin city available on IrishGenealogy (not all historic CofI records for Dublin city survive..).