Yes and no. Game provides no machanic for the city to surrender (and it is unlikely to be added so late in the life-cycle), but to insist that in CK2 universe every city holds out to the last is unwarranted. It's a playable, gameable abstraction.
Additioionaly if we are talking about European or Middle Eastern lord then those who wanted to add the city to their own holdings had every reason to want as little damage to the economic base as possible. Depending on the situation leader of the army may just accept it as inevitable, buy off solidiers (since during the sack more value will be destroyed than plundered at times it still may be better than suffer reduced revenues for the years to come) or - in a few cases - just manage the army through the sheer discipline. You don't need to have moral qualms to not want the looting if espect to hold the city thereafter - economical self-interest will do.
Also note that army starts "to burn" which seems to indicate out-of-ordinary disorder. Eben Mongols who did at times durn the cities as a terror tactic preferred to do so in orderly manner, to ensure that no portable loot which could be carried away will perish in the flames. Remember: pillage, then burn.