If you are still paying on your car loan, you can reconfirm the loan in Chapter 7 and continue to drive, and eventually own your car with regular payments. You could also use the Chapter 7 process to shed your loan obligation on an underwater car loan.
If you own your car(s) outright, there are exemption limits in each state that will protect your vehicle.
You can typically keep your vehicles in a Chapter 13 bankruptcy.