Actually, I think it's the DMs duty to try to portrait every enemy, not just major villains, in a believable way. Especially for intelligent foes that means you have to think about their motives and their evaluation of the current situation which should guide how they're acting.
This can mean that enemies flee early, late, or never. It can also mean that they aren't interested to engage in combat at all and try to bargain.
Having enemies flee when it makes sense for them to do so also happens to be a convenient way to shorten combat encounters with a foreseeable ending. I'd actually hope for every DM to consider this preferable to grinding it out!
This covers most of what I was going to say.
In closing, if the dragon was notorious as a lethal, cunning, and savvy opponent during campaign play, it flees smartly. It it has been portrayed as an angry belligerent brute of rage, it might fight to the death. Maybe.
Foreshadow you villain so when it bails, the players can say "I knew it the #$%@ was going to run" or even plan ahead for it.
