The odometer is actually quite accurate, the error is in the amount of deflection of the speedo's needle. The odometer information that you see is stored in the instrument cluster and is given to the instrument cluster by the ECU (again, gathered from the ABS sensors in the D40).
Easy enough to test: either on one of those odometer test areas comparing it to the trip meter (which measures in increments of 100m, so there's a chance of 1/50 error) or on a long journey using a GPS mapping tool (which has a chance of up to 10m of error in position at start and finish, so it could be out by 20m total).
Using the ABS rings for speed/odometer information is a good idea. You can't guarantee that the vehicle is moving if it's lifted a rear wheel, so there's value in using the aggregate value from all 4 wheels (probably a "best 3 of the 4" reckoning in the ECU). The number of rotations of the wheel are sent to the instrument cluster (odometer) and the number of rotations per unit time are sent as a voltage (speedo).
This is also used for traction control and for deciding whether or not 4WD can be used (which is why your 4WD light comes on when a wheel bearing starts to let go and the ABS ring fills with debris). It's basically a good system that - most of the time - provides accurate information about the car's movement. Drifting, sliding on ice or moving through surfaces like sand/mud/gravel are exceptions that this system can't really be 100% accurate on, but for general use it's pretty good.