All of these good solutions, but none of which work for a level 26 with not even Dragon Call to my name. The only thing that would possibly work for me would be to turn into a werewolf and use the fear howl, but A) I have the Brotherhood howl and everyone would be dead by the time I went to the underforge and changed and;

then the same townspeople would attack me and I'd have to get bounty myself
If you have nothing to slow or end the attack, your fighting skills are not good enough to defend and your pickpocketing skills are not good enough to better equip your NPC's all that is left is probably to avoid the towns till you level up a bit more or get better skills and want to try it again. You should be able to sell and buy stuff with which ever faction you joined, and you can raid as many enemy locations as you like with no fear of losing NPC's. So even if you finished Dawnguard first and then tried to go back to other quests, at least your character should be better able to handle the attacks.
The attacks are worse in Riften, the vampires attack in the market.
Would be nice if there were more guards posted in areas where the vampire attack.
Also the guard presence in Skyrim is undermanned, remember Oblivion when you go into a guard barracks and there are about 20 guards in there.
Also the Guards in Oblvion were a lot more powerful then the guards in Skyrim and towns in Oblivion never came under attack like they do in Skyrim.
I would have to say I made the mistake of going to the Riften stables first the other day, when I was trying to get into Riften without drawing much attention. This resulted in a Dragon attacking Riften, since dragons just love following Braggen around. If it had been a usual fire breathing or cold breathing dragon, just about every NPC in Riften would have been dead. It was one of those weird Revered Dragons that throws spells so only three NPC's were lost. I gave up and tried it again, fast travelling straight to Riften where Braggen avoided any dragon encounters and just had the usual random encounters.