Depends on the state....Usually most states hold this to be harmless error that can be corrected immediately or by reissuing the ticket. Mainly it depends upon whether your ticket correctly informs you of your charge. I live in Southwest Michigan and my Girlfriend got a minor parking ticket in a subdivision. The Officer who wrote the ticket did not enter my Girlfriend's license plate number correctly and mistakenly entered an "F" instead of an "E". My Girlfriend called to ask if the ticket should be waived because of the officer's error and the county office waived the entire ticket. Other than that one letter the entire parking ticket was correct and accurate. The make/model, color, and violation were all correct. However, because the error was made by the officer, the ticket was void.
Presuming your saying a ticket was issued for a car that isn't yours: You simply need to contact the court, generally the Clerk there, and say what the story is. They will generally tell you to provide the proof...for example that your car is a different make/model/color than that on the ticket (seen on the registration), or lisc. plate is different, etc. and they will remove the ticket. If the car the ticket was given to is registered to you and has the plate identified, then the ticket is yours.