It shouldn't be legal, unless you're in a job like a first responder or other emergency services. We kept getting reminders all the time to stay cool, stay hydrated, go to cooling centres if we didn't have access to AC or fans, and not to exercise outside. The Weather Network had extreme weather warnings going for weeks.
I had to go out twice during the heat dome last year. My age group was finally approved for the 2nd covid shot in July and I didn't want to miss my chance (the pharmacy bookings were filling up crazyfast).
So I arranged a ride through the local seniors' centre and we went to the pharmacy... only to be told they were out of doses, but if I'd stick around, they should be in by 4 pm (their driver was picking them up in Edmonton).
Well, it was only just after 2 pm and my driver had other appointments to keep. Neither of us were inclined to sit around in a grocery store pharmacy's waiting area for 2 hours even if store security had let us (they expected people to wear masks and get in and out ASAP). And it was absolute torture wearing a mask in that heat.
So I told them I couldn't stay, I wasn't happy that they hadn't warned me in time to cancel my ride - since I had to pay; the drivers for this place don't do it for free - and to put me on the shortlist for after they did get the stuff in, keeping in mind that I'd need time to arrange another ride (they suggested I try another pharmacy, but the reason I'd chosen this one in the first place was because the others were either booked up solid and not taking new appointments, or had no clue what was going on and were really rude over the phone).
About a week later I did get my shot. But at least the pharmacy staff felt guilty about the wasted trip, so they gave me a $10 gift card to cover the cost of the ride. I ended up using it to buy Maddy a box of kitty litter.