I've heard ...
Heard from whom? I know a lot of them advertise identical quality
but did you ever confirm that to be the case?
You can choose what types of lenses you want. Zenni, for example, offers multiple lens options, some of which are from specific brands.https://www.zennioptical.com/glasses-lenses
When you buy glasses from a bricks and mortar optician, you're getting whatever bog-standard lenses they sell, unless they specifically mention they're high index, or have some specific feature/coating, or are from some specific manufacturer.
Just like when you buy glasses online.
There are definitely differences in lens quality, but the available range is just as wide in retail stores as it is online.