In short, yes, you can buy a car in France and register it. The car registration document law doesn't specify that a requestor must be legally staying in France to apply. As far as an applicant can present the standard supporting documents required to apply, the registration must be accepted.