B&M Store: Factory > Warehouse > Store > You
Obviously that's generalizing quite a bit, but intuitively it seems that the major difference is the final step. On average a delivery driver is more efficient than you making a trip for just yourself.
I have friends who live way out of town. If they have a store it serves maybe twenty people. Instead of dividing the truck’s emissions by thousands of people you just divide it by twenty.
On the other side often things bought online come with a lot more packaging. I think Amazon is trying to cut down on this by having suppliers where possible use a box for a product that is durable enough for shipping without having to put it in another box.
That said, in practice the "economy of scale" argument still applies and the inner-city store will overwhelming produce less carbon, besides the fact that a rural area may imply an increase in the distance good are shipped.
In a dense city, most of the last mile will be served by foot walking to a store which would have lower emissions (zero) compared to a delivery vehicle.
In the suburbs, the last mile to a store will likely be a detour by car from wherever you wanted to be. So delivery probably has a smaller footprint than storefronts (since the delivery vehicle is likely doing deliveries nearby anyway).