Modern gasoline engines have sensors to measure the amount of air that enters the engine. The ECU then injects fuel to give the correct mixture to get the most efficient burn. A dirty air filter will first show itself by limiting the flow of air at high throttle positions. Rather than causing a rich mixture however, the ECU will see the low air flow and inject fuel as appropriate. What you may notice, is a lack of power, not an increase in fuel consumption.
A diesel engine is lean burn engine and also has metering. The throttle determines how much fuel is injected, but once again, the ECU knows how much air has been taken into the engine and will not allow more to be injected than will give an efficient burn. So a dirty filter will only affect performance.
You could possibly use the OBD2 parameters to monitor the throttle position in a gasoline engine and compare it to air flow and determine over a long period how the dirty air filter is affecting air flow, but I can't imagine it being very accurate.