Pay at pump is safest obviously, but primarily because Visa/MC made a special MCC called automated gas dispenser - that always counts for the 5% bonus (unless Chase removes certain merchants, which they did not.)
Inside, is hit or miss. For some Kroger, the mini-mart is also gas station (especially when it uses a different POS than the grocery store). In fact, I think all of Kroger fuel is now owned by an outside company and is just a name licensee? Almost all Safeway mini-marts are coded as grocery store.
For many standalone stations (Speedway, 7-11, Racetrac), most insides are coded as gas stations. The ones I would worry most are those that have oil change or travel stop places.