No. RAW they fall instantly with no chance to fly again
PHB rules are unclear: entirely up to your DM
The rules on falling in the PHB/basic rules state:
A fall from a great height is one of the most common hazards facing an adventurer. At the end of a fall, a creature takes 1d6 bludgeoning damage for every 10 feet it fell, to a maximum of 20d6. The creature lands prone, unless it avoids taking damage from the fall. (PHB, p. 183)
If you go strictly by PHB rules only, then there is no answer and the DM must decide. See below for why allowing it to be used your way is a bad idea though.
No, according to XGE clarifications.
However, using the clarification from the preface to the optional rules on falling in Xanathar's Guide to Everything makes this default rule much clearer.
The [PHB] rule for falling assumes that a creature immediately drops the entire distance when it falls. (XGE, p. 77)
So, using the default rules as clarified by XGE, a creature has no opportunity to do anything once they start falling. They immediately fall the entire distance and take however much damage or other effects they have triggered. Having a fly speed doesn't matter here because it doesn't change the rate at which falling occurs.
Do note, that while possibly a bit counter-intuitive, it makes a lot of mechanical sense. Allowing flying creatures to be able to use falling in the way you suggest would essentially give them a huge amount of free, OA-free, movement in the air. Given that flight is already a powerful boon, it makes sense to prevent this additional advantage.
Do note that, RAW, flying creatures only start falling under very specific circumstances:
A flying creature in flight falls if it is knocked prone, if its speed is reduced to 0 feet, or if it otherwise loses the ability to move, unless it can hover or it is being held aloft by magic, such as the fly spell. (XGE, p. 77)
So, RAW, you cannot use your fly speed to avoid fall damage in the way you propose.
In your case, your flying creature would fall 500 feet and take the appropriate amount of fall damage. After which they could take whatever actions or moment they have available to them.
Optional rules for falling flying creatures helps them a bit more
XGE even has a very specific optional rule to help flying creatures survive falls. This also is great support for the above RAW ruling, because if they could just avoid all damage simply by having a fly speed, the rule wouldn't be needed. Note specifically also that these rules are supposed to give a better chance of surviving a fall for flying creatures. If they could avoid it by using their fly speed, then this would actually be giving them a downgrade.
If you’d like a flying creature to have a better chance of surviving a
fall than a non-flying creature does, use this rule: subtract the
creature’s current flying speed from the distance it fell before
calculating falling damage. This rule is helpful to a flier that is
knocked prone but is still conscious and has a current flying speed
that is greater than 0 feet. The rule is designed to simulate the
creature flapping its wings furiously or taking similar measures to
slow the velocity of its fall.
If you use the rule for rate of falling in the previous section, a
flying creature descends 500 feet on the turn when it falls, just as
other creatures do. But if that creature starts any of its later turns
still falling and is prone, it can halt the fall on its turn by
spending half its flying speed to counter the prone condition (as if
it were standing up in midair). (XGE, p. 77)
Using this rule, a flying creature can survive falls better, but they still aren't able to use their fly speed to completely avoid all penalties unless they are falling from very high altitudes and the fall takes more than one turn to complete. However, in that specific case, they can use their fly speed to help prevent damage.