The safest and most common way to handle this is to complete the transaction at the seller’s lending institution (bank or credit union).
Buying a car that still has an active loan (often referred to as having a "lien") is entirely possible but requires a few extra steps to ensure the title is legally transferred to you. The lender technically owns the vehicle until the debt is satisfied, so the transaction must involve paying them off directly to release the lien. buy my financed car