As long as your airbags deploy and your locks are working correctly the automatic doors locks on your car should unlock immediately after the airbags deploy.
If the airbags don't deploy during the accident then the door locks on the car will usually not unlock and you'll have to manually unlock them.
On newer cars and vehicles the doors automatically lock to keep the door from flying open in the event of a car crash because if the doors fly open then you could be thrown out of the car and be killed or injured worse.
So it's best to have the doors locked but they should unlock automatically during an accident as long as your airbags deploy.
The car doors may not always unlock so you may need to unlock them or someone with the rescue crew may need to smash your window out to unlock the door to get you out.