The real question is not can I use C++, or indeed any other programming language, but rather what is the platform hardware and how is the software loaded onto the platform.
The truth is when most people talk about reprogramming vehicles they normally mean tweaking the parameters used by the engine management system in its decision making, for example altering the timing on the sparks, which is normally, and often easily, done by connecting the the CANBus which provides access to that sort of thing as well as status data. Note I would not suggest tinkering unless you really know what you are doing as you will certainly invalidate any manufactures warranty and you can easily cause serious damage to the engine.
Anyway back to the original point, if you can work out how to access the platform used by the engine management system and how to create software to run on that platform you still have the issue that your software would need to do everything the original software did plus whatever modifications you plan when you write it. This means you need to know not just about the processing platform but every other piece of hardware it interacts with in detail so that you can produce the correct behaviour, information that would be hard to come by. And of course that doesn't consider any security measures the manufacturer might have put in place specifically to prevent such a thing.
Note that this is basically the same problem as any problem were you are considering reprogramming a bespoke system made by someone else.