It depends on the vehicle make/model, but nearly all modern vehicles use an electronic signal to record mileage and speed, so nothing happens unless the key is on and usually the engine running. Older vehicles with a mechanical speedometer cable system will record miles while in tow.