I want to start by recommending some possible ways to enter a city from "Skyrim." This will obviously not apply to "entering" the city from a building in the city.
1) Fast travel to the stables or neaby land mark, not into the city itself.
2) Wait for daylight (hopefully, NPC vampires are weakened by sunlight, though I don't know for sure.)
3) the next part will depend on the city, and I don't have much experience with some of the cities, but:
a) For Whiterun, they seem to spawn at the main gate, so go in that way.
b ) For Riften, they seem to spawn at the Marketpalce, so DO NOT go in by the main gate. Rather, if you are standing just outside the city, fast travel to Mistveil Keep.
c) For Windhelm I have seen them spawn between the Palace and Candlehearth Hall, so you might want to fast travel to the Palace rather than go in by the main gate.
I have no info on Solitude or Markarth; haven't seen a vamp attack there yet, but I imagine the main gate for Markarth would be good, same probably for Solitude.
BTW, I have never had a dragon attack in Whiterun, Riften, or Markarth. Only Solitude and Windhelm. Do dragons only attack in Solitude and Windhelm?