You can just unlock the door and exit the car in that case-- there's no way to "lock someone in" unless you've modified the lock somehow. And if someone did that, they probably reinforced the glass too.
Well, I learned something new today! I always thought that kind of thing would be illegal because it's a fire hazard -- if the driver was unconscious after an accident, the passengers could be trapped in a burning car.