Your itinerary appears to be BA152 from IKA-LHR, and AC849 (probably) from LHR-YYZ. But you haven't specified whether you bought these flight segments together on a single ticket, or separately.
When you purchase flights separately, the airlines in most cases do not transfer your baggage, and you are required to clear immigration and customs and transfer the baggage yourself. In this case you must also carry your baggage from Terminal 5 to Terminal 2 to check it in with Air Canada. In this specific case, BA would not transfer baggage.
In your case, this would mean that you must qualify to transit the UK landside. Based on the information you provided, it appears that you qualify to transit landside without a visa, but the final determination will be made by a UK border officer when you arrive at passport control. Present your passport, Canadian residence card, and onward ticket to the immigration officer.
Further, when you have separate tickets, the airlines are not responsible for any delays that may cause you to miss your connecting flight. If the plane from Tehran is delayed (as it often is), immigration queues are hours long (as they sometimes are), or something else happens that causes you to miss your connecting flight, you must pay to have your flight booking changed to another flight, and you must pay for any food and accommodations also. If you bought low-cost tickets, they may have very high change fees.
These problems go away if you purchase a single itinerary for your entire journey. For instance, a single booking with BA for IKA-LHR and LHR-YYZ (which BA do fly themselves). You do not have to transfer your baggage or clear immigration and customs on such a booking. You will be able to remain airside (and you also appear to not need an airside transit visa) And if you miss the connecting flight due to the plane being delayed, BA is responsible for the costs of rebooking and any overnight accommodations you might need because of the delay. The cost of a single booking might appear to be higher, but it eliminates a lot of risks to your travel.