OK, here's why you want to goose a big scary dog attacking you: There are sensors in the interior of the anus which, when stimulated, cause a gasping reflex. And if the dog is gasping, its jaws can't be clenched down on your arm.

(That is, according to my Animal Science proffessor, Dr. W. Bruce Currie. Yes he used the term "goose" in class.)

That's also why, when delivering a newborn calf or foal, you want to stick your finger up its butt to get it to take its first breath. Current theory also has it that when a doctor slaps a human newborn on the butt, the reason that a gasp is stimulated is because of interior anal sensors, not because of pain.