Note: the answer below seems to conflict with information on official UK government websites. I'm leaving it up so that the "official" Timatic advice is available, but I encourage other folks to provide different answers if they have more expertise than I do.
According to TIMATIC, which is the system that airlines use to check immigration requirements:
In the UK, the following people are eligible for TWOV (Transit Without Visa):
Nationals of India with a normal passport transiting through London (LHR) with a confirmed onward ticket for a flight to a third country on the same calendar day. They must:
- have a visa issued by Australia, Canada, New Zealand or USA, and
- stay in the international transit area of the airport, and
- have documents required for the next destination.
...
Nationals of India with a normal passport making a landside transit with a confirmed onward ticket for a flight to a third country that departs before 23:59 the next day. They must:
- have a visa issued by Australia, Canada, New Zealand or USA, and
- be traveling to the country that issued the visa, and
- clear immigration, and
- have documents required for the next destination.
In Ireland, the following people are eligible for TWOV (Transit Without Visa):
Passengers transiting through Dublin (DUB) with a confirmed onward ticket for a flight to a third country. They must:
- arrive at and depart from Terminal 2, and
- be transiting between 04:00 and 16:00 on the same calendar day, and
- stay in the international transit area of the airport, and
- have documents required for the next destination.
So, to summarize:
- If you have a valid tourist visa for Canada, it appears that you can make both of these transits without a visa so long as your transit at Heathrow does not involve leaving the international transit area, and so long as you arrive & depart from Terminal 2 at Dublin. Whether or not this will be possible depends on the airlines you are using.
- If you need to arrive & depart from different terminals at Dublin, you will need a visa for Ireland.
- If you need to leave the international transit area at Heathrow, you can still transit without visa there but you will have to clear immigration in the process.
Moreover, it was pointed out in the comments (h/t @AndrewRay) that since the UK and Ireland are both in the Common Travel Area (CTA), the LHR-DUB flight may be treated as a domestic flight, meaning that you would have to transit landside in London and that you would not be able to "remain in the international transit area" in Dublin.