Chances of that are microscopic.
But lets play - so I let my dog run around in a blind panic to save your kid from the burning fires of whatever the fuck..
He runs into traffic, causes a multicar pile up and five people are dead.
That sounds smart.
Or - I get me and my dog out, tie up my dog, call emergency services and see what I can do to help... no further accident caused, yep, you and your kid might die, but equally they might not, I might be able to help (I won't btw, I am a power wheelchair user, I've already burned to death by being on the 5th floor of a building that has no evac chair or no one trained to use it).
The hypothetical game is endless, pointless, gets peoples backs up. As I said, most people do not know how they'd think in a crisis or what they'd do and many would be really shocked at their responses.
Pitch the hypothetical different - you're a parent with two children, the building is on fire and you have to pick one to save first... which one?
Change it so now its your toddler and someone elses toddler... someone elses toddler is nearer, but yours is.. yours.
Or how about, a kid in a power chair, you need to disconnect the controller from the wheels via the levers on the back to push it, the controller cable has melted... you can save him OR you can save two toddlers. Which do you pick?
See, it's horrible, it's stupid, it's not a useful answer and you simply do not know what the truth is anyway.
Very very few people are going to make rational, sensible, considered choices. Most likely they're going to grab whoever is nearest, if they are not blinded completely by the desire to save themselves.
Back to the dog situation - my dog is likely on a 4ft lead clipped to my waist. The chances of me thinking to unclip him to free me up to go get someone else are vanishingly small, vs just getting the fuck out. That would be me having to de-select a default choice -fix my dog to me in case of emergencies - in order to think about someone who is not my responsibility and I have never thought about before. That isn't how brains work in a crisis.