Check the fare rule. Most international fares allow unlimited connections within the Maximum permitted milage.
So you should be allowed to overnight in both YVR and YYZ.
However, add up the individual milage segments and made sure you don't go over the MPM, which is calculated on HKG-IAD.
(Added bonus for E/SE - if you do an overnight connection on an upgraded ticket, the original upgrade lifted at origin is valid for the connecting segments. I have done this before on HKG - YVR - YYZ - LGA. The agents at YVR don't even blink.)