I can think of half a dozen ways to criticize my answer, none of them having to do with the "child" preference being so obvious that it needs no justification.
Really, think about it. You're a firefighter, you storm into a building, you find a child in a room, you need to get the hell out right now. Do you sit and think, "hmmmm, what if there's two children in a room down the hall? Do I sacrifice one to save the other two? What would Jesus do?" NO! You grab the kid and get the hell out. What if you find the dog first? You grab the dog and get the hell out. What if you find both? You hold the dog in one arm in the kid in the other and you get the hell out.
There are all kinds of ways this scenario would be handled, and I bet none of them would involve flipping a coin or the speciesist view that requires leaving behind a dog if you find it first, but -- and this may sound crazy -- but preferring whichever person or animal is closer to the entrypoint or whichever one is found first.