Depends on what we consider wrong. Could you pull a car that way? Theoretically, yes. Could you save energy that way? No, because the car driving in front would have to do extra work to overcome the magnet pulling it towards the car behind. You can't cheat the first law of thermodynamics.
It would only work if you manage to keep the car at an extremely precise distance from the car in front. If you're off by tiny tiny amounts, you'll either lose the magnetic attraction, and stop, or you'd started getting closer fast until you'd be stuck to the car in front of you