Ahh this question always comes up eventually as some sort of trump card in the 'children/humans are more important than animals'.
It is also generally posed by people who have never actually been in any sort of emergency situation.
In an actual emergency you don't stand around thinking, you just act (well if you want to save people/animals/not die, you do. I guess some of you might pontificate til the house burns).
Logically, I am yeeting from the burning building the first beings I come across, that I can. If that is my dog, so be it. If it is your child, so be it.
I am not running past someone I can save in order to find others I may not save.
I know that was my mindset as it has happened (wasn't a burning building though I'd just have died).
If I am standing on the side of the river and two are drowning and one is my dog and one is your child, I'd go for my dog first - because my dog is unlikely to drown ME in the process of saving him, then I can come back for your child.
I make that decision not purely because I like my dog more than I like your child, but because I know (again, experience) that grabbing a drowning human is likely to result in both our deaths, grabbing a drowning small dog is not.
Or I might decide both are fucked and me adding to the death toll helps no one!
When it comes to emergency situations, 'value' is generally not what we're thinking about. Its 'can I save' and 'Will I survive' and 'oh fuck'.
The really brutal reality is that if there is a situation that involves my dog and someone elses child, I've probably not even noticed your child because my dog is my priority, and your child isn't.
We can go all around the houses with various ideas but until and unless you are in that situation, you do not know what you would actually do and a good proportion of people will flap about pointless and save no one and probably kill themselves in the process. After all, we are just frightened animals, prone to panic and irrational behaviour... just like all the other animals, in the end.