Dealerships: Dealerships typically are responsible for ensuring the vehicle passes a smog test (in states requiring it) before selling it. Their responsibility may also extend to certain pre-sale repairs, depending on the state's laws and the terms of the sale. They often have implied warranties against major defects.
Private Parties: Private sellers generally have less legal responsibility. They are usually *not* required to have the car smog tested or make repairs before selling it. However, some states might have disclosure laws requiring sellers to inform buyers of known defects. Lying about known defects could open the seller up to legal action. There is usually no implied warranty.
In short: There's no universal answer. To know the specifics, you must check the laws of your state or jurisdiction regarding used car sales. A contract between the buyer and seller (whether formal or informal) will also specify responsibilities. If a dispute arises, consulting with a legal professional is advisable.