I had this happen but with Riften. No idea what was causing it since no Dragon would show up. In the end I searched around outside the town until one appeared, then ran into the town to make it show up inside. After killing it things seem to be back to normal... for now.
I think what may have happened was the Dragon that tends to spawn outside the town may have spawned just as I was entering and I missed it. Either that or I fast travelled just as it spawned, and the npcs kinda got stuck that way. Try looking for a Dragon close to Whiterun *one tends to spawn on the plains*, once it's attacking you head inside the town and it should follow you inside as well, hopefully once it is dead the npcs will start acting normal again.