This subject is more complicated than it should be mainly due to terminology differences over the years.
When I was growing up (late 60s thru early 80s), my Grandpa referred to his stuff as O27 and my Uncle's as O-Gauge. But, there was as much commonality as there were differences. The main difference was track.....my uncle's O-Gauge had a higher profile (taller) which provides better electrical connectivity, 31" diameter curves, and O22 switches with separate power terminals and non-derailing. The O27 track was shorter, came with 27" curves, and 1121 switches that used only track power and didn't have non-derailing features. RE: O27 was a bit cheaper.
When it came to locomotives and rolling stock, my uncle had two sets that were two big to handle the 27" curves of O27....the Virginian Trainmaster set and the Santa Fe F3s with 15" passenger cars. In today's vernacular these engines were (or were close to) 1:48 scale. But, even though my uncle ran "O Gauge", some of his stuff ran fine on O27 like his 2023 UP FAs and a 2-6-2 steamer. He did not own the 773 4-6-4 Hudson which was, I think, the only steam engine close to 1:48 scale in that era, nor did he own the 2-8-4 Berkshire which I believe was rated for minimum 31" curves.
The problem is that O27 does not always mean non-scale or semi-scale. My grandpa's O27 stuff included a 0-4-0 1656 steam switcher and an NW-2 diesel switcher both of which I'm told are close to 1:48 scale. But, because yard switchers are generally small, a scale-sized model can handle very tight curves.
I ended up inheriting my grandpa's O27 collection. I've found that Lionel Traditional, MTH Rugged Rails, and Atlas Industrial Rail are safe matches. MTH Rail King is at least a little larger and, in some cases, absurdly larger, so I'm very careful with Rail King purchases. K-line items are usually safe for size matches unless they specifically say "O Scale".
Some of these distinctions are no longer relevant. If you run O27 tubular track, you can now purchase 42" and 54" curves to allow for operation of bigger engines and rolling stock.
Hope that helps.