If you finance a used or new car through a dealership and make the car payments on time then yes you'll build your credit score by making those car payments until the car loan is paid off.
If you have bad credit some used car dealerships will still approve you for a used car loan and then as you make the car payments on time over the life of the car loan then your credit will increase to where you could purchase a new car as long as you have enough money for the down payment.