Here is an interesting overview and comparison of how to open doors on Tesla cars in the event of an accident if the standard method does not work. In the case of any car, the primary source for this information is the manual.
DÆrik provides video for all Tesla Models (S, 3, X and Y). The alternative way of opening the doors in the case of emergency differs between the versions, as well as between the front and rear.
In Model 3 and Model Y there are buttons to open the doors and lower the frameless window. If it does not work (the power is off), there are manual levers (only for the front doors). At least some versions of the Model Y might be equipped with a mechanical release cable in the rear.
"The car manual will clearly show how to do this and in this video we will go over S, 3, X, & Y.
Some early Model Y manuals stated that there is a manual release in the door pocket for the rear. But that part is no longer in the Model Y manual. So it might have been removed. Do you have it in your car?"
In the Model S, in the rear there are mechanical release cables under the bench. The front doors work the same even without power (it's mechanical).
In the Model X, the mechanical release cables are in the doors (the rear doors feel heavier if opened manually). The front is mechanical as in the S.
If the doors won't open either way - standard or alternative - the next step is to escape through the trunk (using mechanical release cables if available) or windows. The ultimate solution is breaking windows, but some windows are laminated (front windows in the new Model 3/Y).