If I had to speculate on what the users are thinking, the problem is that the fuel inputs over a month are somewhat unrelated to the fuel consumption during the month. In other words, the tank may start empty full or somewhere in-between. And, it might end empty, full, or somewhere in-between.
That means that your calculation can be off by up to a tank-full of fuel on either side.
Now, this could be mitigated by particular circumstances. For instance, perhaps the vehicles are being driven every day, with their fuel tanks filled at the end of the day. So, at midnight, you have a reasonable assumption that the tanks are full. I would be surprised if this were the case, because the inventory of fuel in the cars costs money. They could hire me as a consultant to improve their balance sheet ;) (just for the record, that is not my specialty).
As a small note, you can do the full calculations in SQL. You don't need to use two queries or any client side calculations:
SELECT 10 * SUM(liter) / (MAX(km) - MIN(km)) as AvgFuel
FROM diesel
WHERE diesel.dato >= '$dx' AND userid = ".$_COOKIE['userid'].";