Whether or not you can pump gas at a closed gas station depends on if the gas station is just closed overnight or if the gas station has permanently closed.
If the gas station is just closed for the night or for the weekend then the gas pumps may still work and be on to allow for gasoline purchases through use of your debit or credit card.
There's a gas station in my town that closes around 8:00 PM but they leave the gas pumps on and you can use your debit card or credit card to make the gasoline purchase.
You insert your credit or debit card and then start the gas pump.
Then the credit card or debit card transaction covers the cost of the gas.
But not all gas stations keep their pumps on at night and some gas stations will shut off the power to the pumps inside.
If the gas station is permanently closed then no you cannot still pump gas from the permanently closed gas station.
At a permanently closed gas station the gas storage tanks will be empty and the electricity will likely be shut off to the building or at least to the gas pumps.
The gas pumps may also have locks on them.