Let's assume that noise and posturing have failed to dissuade attack from the dog(s), you are completely unarmed, and the dog(s) in question is of sufficient size to pose a real threat of injury or death.
I think scenarios 1 and 3 will have the same answer. There isn't really a functional difference between the motives for aggression and both a rabid animal and one bred and trained for fighting are going to have difficulty processing pain and disengaging hostility under typical biological and situational norms.
A canine's only deadly weapon is its mouth and teeth (disease is something to deal with at a later time). You want to minimize its ability to do damage to you, while leaving yourself open to incapacitating or killing the animal. Fortunately, as humans, we (typically) have two amazing manipulatory limbs available to us for just this sort of occasion. You will need to be prepared to use one arm defensively and the other offensively (so promptly decide which is which). The defensive arm is going to get hurt. If you had time to wrap the defensive arm with a shirt (or the like) you probably also had time to find another way out of this situation. So, we will assume that you have only a few seconds to react to this dog attack. Whether you are on your feet, or have been taken to the ground, you will want to face the animal in order to adequately defend yourself.
If you can stay on your feet, then stay on your feet. Keep facing the dog while slowly backing away from it. try to keep your stance wide enough that a sudden lunge from the dog won't knock you down or off-balance. Keep your defensive arm ready to fend off an attack, and be prepared to deliver a savage low kick if an opportunity presents itself. If you keep slowly moving away in a sound defensive posture while meeting probing attacks with a painful kick, there is always the possibility you may convince the dog to break off its attack.
Instinctively, a dog will try and attack your throat (unless it has been specifically trained otherwise). You do not want to let a dog get its teeth around your neck (the badness of this goes without saying). When rushed by an attacking dog, you want to be prepared to shove the forearm of the limb you have designated for defense (we'll presume this is your non-dominant hand) as far back into the dog's mouth as you can. You want to try and shove it back behind the dog's cuspids (canine teeth). The cuspids are the teeth designed for tearing flesh and instinctively dogs will thrash their heads from side-to-side when they have a firm grip with their cuspid teeth. You want to push your arm to the back of their mouth and maintain backward pressure (as if you are trying to push your forearm through the back of their head). Doing this puts the dog in an awkward and uncomfortable position, and it will try to disengage and bite again. If you are on the ground, you want to try and prevent the dog from disengaging and getting another chance to bite you. It's far better to have some superficial injuries to your forearm than to let the animal get its teeth on your face or neck.
Under normal circumstance, you might be able to use pain to demotivate an attacking animal, but we a talking about rabid dogs and animals bred for pit fighting. Pain won't be effective in the same way it normally would. If such is the case, we must assume that disabling injury or death are the only avenues left open for the sake of survival. With the dog's mouth busy trying to sort out your forearm, you can either attack the first cervical vertebrae (C1) with hammering, downward blows, or you can try to cripple the dogs legs (via kicking, stomping, or hyperextension of the joints). We are talking about saving your own life at this point, and you must be prepared to use extraordinary means to do so. It may seem cruel, but savagely breaking/dislocating a dog's digits, wrists/ankles, or forelimbs may be your only option. Rabid animals can't think clearly and fighting dogs are used to being hurt on their faces, ears, and neck. You shouldn't waste your time twisting ears or gouging eye's. Striking at the base of the animal's skull (and/or C1) is one of the most effective targets for an unarmed strike (especially with your other arm occupying the dog's mouth), and can easily result in the paralysis or death of the target.
If you are on the ground, you will want to try and stand back up (while keeping your forearm in the dog's mouth if necessary). Once you are on your feet, slowly back away towards a perceived means of egress, keep facing the threat (the dog), hold your defensive arm ready to ward off attacks, and be prepared to meet a lunge with a low kick.
Now to address scenario 2. If you are unarmed, and forced into a life/death confrontation with a pack of dogs which is comprised of animals which individually would be considered a viable threat...well....
A large dog's teeth are fairly comparable to a knife as a threat level. If fighting a single dog while unarmed is similar to fighting another person armed with a knife (while unarmed yourself), then fighting a pack of large dogs unarmed is bad news for you (Julius Caesar bad). The best you can hope to do is get lucky and injure enough them that the pack decides you aren't worth the trouble. The same advice for handling one attacking dog applies, but you also have to be aware of every potential threat (dog in the pack) and be ready to face it accordingly. Unlike kung fu movie extras, dogs know how to attack in concert, and that is where a lone unarmed human is out of luck. In a situation like scenario 2, it is probably best to resign yourself to making them work for it (and subsequently choke on it). Against multiple dogs, it is critically important to stay on your feet (though dogs instinctively try to hamstring their prey).