There are communities of people online who do everything they can to exploit credit card reward programs. They call what they do “manufactured spend”.
Buying gift cards at a store you get better rewards at is one of the standard tricks. Kroger is often a target of this because not only can you get credit cards who pay higher rewards for grocery store purchases, but Kroger also gives you those fuel points.
But as mentioned previously in this thread, you have to make sure gift cards aren’t explicitly excluded from the rewards program. And even if they are explicitly excluded, a lot of times the stores don’t have the computer systems in place to track whether or not it was actually a gift card that was purchased. You just have to buy a gift card to see. And if it doesn’t work, maybe try buying a candy bar along with your gift card to see if the computer system still catches it.
This is a lot of work though to save 3% at Amazon. Amazon has their own credit card that gives 5% for Prime members and 3% for everyone else, Barclays has the Uber card that gives 2% for all online shopping.. And if you make your Amazon purchase with a gift card, you lose all the features a credit card may provide, like extended warranty, purchase protection, etc..