Depends on the tax. Road tax, yes per gallon. Corporate taxes and some states sales taxes are based on the dollar amount.
What states charge sales tax on gasoline. I’ve traveled in all 50 of them and don’t ever remember paying more inside than it says on the pump.