I have fought and killed over 50 dragons, but never in a major city.
THis, unless you count the college or winterhold. Morthal too. But I don't consider any of these major cities, lol.
I'm only going to
assume there's less of a chance to attack inside major cities
by design, since there are so many vulnerable and useful NPCs there.
Killed one just outside of riften walls though, OP
seems to me that the dragons may attack cities more after you complete quests there. Just my experience.