Hi Kate,
It's wonderful to hear that you will be visiting Dublin in June. I would say that both options are excellent, be that staying in the city centre at a hotel that provides parking or at accommodation outside the city.
This
Accommodation page may be helpful to you in finding suitable options. Equally, this
Public Transport page has useful information on getting around without a car.
If you are planning to spend some time exploring the rest of the island, basing yourself at a location outside of the city may be the best option. Ultimately, I would say that the decision is yours.
Regards,
Eoin