A buyer can trade in a vehicle while making payments on it as the amount that is owed can be added to the new loan. This process is known as "rolling over" a loan and is quite a common practice at car dealerships.
Generally, a vehicle that is traded in to a dealer when money is still owed on it, the dealer pays off the balance due in lieu. For instance, if the owner owes $5,000 on an existing auto loan, and the dealer is offering $6,000 trade-in value, then the dealer would pay off the existing loan and then take $1,000 off the price of the new car being purchased.
However, if the dealer only offers $4,000 as a trade-in value on the vehicle, and the outstanding balance is $5,000, the dealer may still pay the $5,000 to the existing lender. The remaining $1,000 that didn't come from the trade-in amount will be added onto the new loan amount.
If the trade in value of the car is low, paying off the amount owed on the vehicle may be for the best. Keep the car and pay it off as scheduled, and then make a trade after sending off the final payment.