Can you use iphones (old and new models) while they're charging?

Can you use iphones (old and new models) while they're charging?

Added (1). i mean even when they run out of battery?

If the phone is totally dead it won't turn on, if its not totally dead you can still use it

Can you still drive your car when its out of gas? I would assume when you have no battery left then no, you can't use it.

If the phone will not turn on due to a dead battery it would still need a few minutes to get a charge.