Ok, that would be possible, having an independent system checking the car for modifications. Though, this system then again could not be open for the user to modify.
And of course, this all would basically ban all cars with modified software from the roads. So you can modify your cars software, but not use the car in public traffic.