Yes you could use public transport (get the Leap Visitor Card).
The transport journey planner recommends Dart and bus....
https://www.journeyplanner.transportforireland.ie/journey-planner?origin={"name":"Dun Laoghaire Dart Station, Dun Laoghaire Dart Station, Crofton Road, Dun Laoghaire, Dublin, A96N7C6","coordinate":{"latitude":53.2949116846326,"longitude":-6.13448230577507},"type":"ADDRESS","eastingnorthing":"32443787,22877500"}&destination={"name":"Kilmainham Gaol (97)","coordinate":{"latitude":53.3421088,"longitude":-6.3101689},"type":"ADDRESS","eastingnorthing":"31260019,23373569"}
However, personally, I would take the Dart to Connolly Station and then get the Luas (tram) Red Line from Connolly as far as the Suir Road Stop and from there walk about 800m/0.5mile to the goal.