You can purchase gasoline with any credit card, but only if it accepted by the gas station itself. You should also consider whether you get bonuses or cash back on gas purchases or not.
Credit cards have different bonus programs, but if you want to benefit from gas purchases, you should look specifically at gas credit cards. These cards are not gas station branded credit cards, which means that you can use them anywhere you like and make any purchase you wish. The cards offer up to 5% cash back at gas stations and usually 1% on other purchases. Since the rewards programs of these cards are more flexible they are probably a better choice than gas station branded credit cards, which often have high interest rates.