Depends on the state and this is tied to emissions.
In CA, it is actually a felony to violate the state smog laws. This precludes an older engine/newer car swap unless the car is 1975 or older.
I wish the state was as serious about illegal immigration as it is smog.