No time to for those decision. Dog is 20 feet out, will be hit in about 1/3 of a second. You jam on the brakes or you don’t. You don’t look in the mirrors, by the time you did you’d have hit the dog already.
There’s a reason why the first lesson of defensive driving classes is to look further down the road, and the second lesson is give yourself an escape path. They are both focused on the one thing that can actually make a difference in kind of potential accident: buy time. You see the problem sooner, have more time to react, and with an escape path you have avoided being in a Trolley. Because in the end the only value judgement that matters is AVOIDING the accident.
Say you know there is a car on your tail.. You're traveling 5 mph? 10? Say the dog is further out, too close to stop but you can swerve. Damage your car? Risk not breaking in time to go in a ditch? Lots and lots of possibilities other than '20 ft out, slam brakes or not.'
the only value judgement that matters is AVOIDING the accident.
Again, if there were always an option that resulted in no harm, or potential for harm, there would be no problem.