Germany already has a toll system installed for trucks on its autobahns, the politicians are just biding their time and waiting for when they will be able to expand the sytem to include all vehicles.
It is all technically possible, although a tax on gasoline per gallon favors lower fuel consumption rather than a fee per mile driven.