Yes; in fact, cars have had this technology since before there was flash memory or GPS or (good) accelerometers. https://en.wikipedia.org/wiki/Event_data_recorder s were originally designed to record the instantaneous mechanical state of the car (e.g. whether seatbelts were buckled, to what degree the accelerator was depressed, etc.) during a crash, for insurance purposes.
I believe most modern cars already have this.