As you noted, there can be energy differences between gasoline even at the same station. That being said, in this area at one time there was a strong correlation between gas bought at certain retailers and their sources. So much so, that one brand worked with the American Cancer Society to conduct product testing showing how much cleaner their gas was compared to competitors. And it clearly showed the gas was from different sources and composed differently - though all meeting the requirements to be considered fungible gasoline.
FWIW, at the time, it was Holiday who sourced their gasoline in the Twin Cities from the Flint Hills refinery in Rosemount, MN, compared to Superamerica who got their gasoline from their refinery in St. Paul Park, MN, and Amoco/BP who sourced their gasoline from Mandan, ND and to a lesser extent Whiting, IN. Since that time, the St. Paul Park refinery and Superamerica have changed hands multiple times, so the refinery is now Marathon and the gas stations are Speedway (but owned by 7/11), the Mandan ND refinery is now also a Marathon Refinery, and terminal was sold off and is now owned by NuStar and supplied by the same sources, etc...
Obviously this will vary wildly depending on the local market. Some places, gas is gas. Others, it can be traced back to an origin associated with a brand...