This idiomatic expression can describe any kind of movement, but is especially linked to running. A scalded dog would be moving as quickly as it was capable of doing, and it would be motivated by pain and fear - that combination makes for some serious speed.
When I heard my old man coming home right when I was in the middle of some afternoon delight with my next door neighbor, he gathered up his clothes, rock-hard dick and all, and jumped out the window faster than a cat can lick its ass.