Upvote:3
Because the UK and Ireland are part of a Common Travel Area, you have to do Immigration formalities in Heathrow. (There will be no immigration at your Irish destination; your second flight is domestic for immigration purposes.) I can't get the Terminal 2 Map to come up. My recollection is there are clearly-marked separate lines for transferring to UK/Ireland (where you need to get stamped in) vs transferring to Rest of World (stay airside, no checks) vs leaving the airport.
If your first leg is on time, you will make this connection without difficulty. With separate tickets you are, of course, at risk of getting screwed over if the first leg is late.