First off, don't turn your back to the dog, unless you're confident that you can't outrun the beast and are already doing so. Even the most beta of dogs will give chase if you run.
Try to stand your ground before backing away and then taking a hard step forward to psyche the dog out. If the dog backs up, just remain dominant.
If the dog doesn't back up you should start backing towards your truck or some where safe. Try to hold something soft between you and the dog so that the dog can bite at it instead of your hand (a hat, an envelope, etc). Dogs tend to sink their teeth into their bites so using the diad as your shield isn't too effective. Ideally, you'd want the diad in your other hand ready to whack that sob if you have to.
Try to keep clenched fists so that they don't bite off your fingers.
Smaller dogs can be kicked/stomped.
Prevention is the best defense against dogs. Never trust their idiot owners. Always scan a gated yard. Approach an open door with caution. Trust your instinct if you don't feel comfortable making a delivery.
I've been told (I don't know the accuracy of this statement) that you absolutely should not
around with German shepherds, rottweilers, and pit bulls.