As long as yo use the Walmart Gift Card at a Walmart Gas station then yes you can buy gasoline with your Walmart Gift Card.
Walmart Gift cards can used at any Walmart Store for purchases of anything you want through the Walmart Gift Card.
Walmart Gift Cards are just like cash and can be used for whatever you want to spend it on at Walmart Locations and even their gas stations.