Rules as written
Players Handbook p.202:
Saving Throws
Many spells specify that a target can make a saving
throw to avoid some or all of a spell’s effects. The spell
specifies the ability that the target uses for the save and
what happens on a success or failure.
Everyone can choose to roll a saving throw; the alternative is submitting to the effects of the spell.
Monster Manual p.87
Legendary Resistance (3/Day). If the dragon fails a saving
throw, it can choose to succeed instead.
A dragon (and some other creatures) can choose to succeed on a saving throw that it failed; the alternative is submitting to the effects of the spell. The difference is that, whereas the saving throw was "free", choosing to succeed costs the dragon a limited resource.
Finally, there is Player's Handbook p.204:
Unless a spell has a perceptible effect, a creature might not know it was targeted by a spell at all. An effect like crackling lightning is obvious, but a more subtle effect, such as an attempt to read a creature’s thoughts, typically goes unnoticed, unless a spell says otherwise.
If the spell is perceptible, the perception depends on the effects. Once the effects have affected the dragon the saving throw is history. The dragon only knows it was the target of a Fireball because it was engulfed in fire, by the time it has that knowledge it has made its saving throw and chosen to use its legendary resistance (or not) already.
The dragon needs to choose to expend this resource in the absence of knowledge of what the effect will be. You can actually play it that way if you want:
Player: "Elbright the Red, utters the mystic syllables and moves his fingers to the weave. The dragon needs to make a DC 16 Dexterity save."
DM: "Fail, he will use his Legendary Resistance to pass. The cold drake twists aside with supernatural reflexes at the last possible moment; what have you got?"
Player: "A flaming sphere shoots from Elbright's fingers blossoming in a ball of fire around the evil drake. Fireball, 28 damage, half on a successful save.