This happened occasionally in NY in the 60's & 70's before computers made life easier..
Car 1 would be totalled and purchased from a junkyard... Car 2 (similar car) would be stolen and the VIN (car1) would be be placed on (car2) and then sold.....and then registered....
Nowadays, if you attempt to register a "junked" car, all serial numbers are checked (VIN verification-performed by DMV).. to match the vehicle... All numbers (engine,tranny,body,etc...) If they are off of stolen car, you are in possesion of stolen property -- crime....