The filler small talk content isn't the substance, it's the launching point for those more substantive conversations.
For instance, maybe you got the hat at a concert in Wichita, and this person at the gas station grew up in Wichita. Maybe they spent their career designing hats. Maybe their deceased kid used to love hats and seeing it reminded them of their kid. You don't know what the "actually interesting" topics available are until you actually spend ten seconds talking to someone.
As with almost anything, people are free to ignore you or reject social conventions, that's totally their right. But it's also totally fine to try to start a conversation with someone.
You're right that some people, for one reason another, might not want to carry a conversation. In those cases, they can simply not carry the conversation. One of the joys of being human, though, is commiserating with fellow humans. If the location isn't one where conversation is strictly verboten (e.g. movie theaters, gym machines, library study rooms), I see no reason why people shouldn't (respectfully) see if the other is up for a conversation.