Isn't the goal for everybody to have fun at all times? I do believe that there is a level range where a fight is interesting and fun; anything below is boringly easy, everything above is frustrating. The level range can be large, but a sandbox which has both level 1 and level 20 encounters just isn't going to work.
Look at our world.
Level 1 encounter? Stealing a purse.
Level 20 encounter? Breaking in to the Pentagon.
For the level 20 encounters, there tends to be a LOT of barriers in the way to get to them. Long distances, or harsh terrain, linguistic or cultural barriers, security, people, etcetera.
You can live in a Level 1 world and 'brush up' against a wide range of people. But, the bigger the differential, the bigger the 'cushion' in between. In a more lawless place, there are plenty of 'markers' that tell you you're getting into risky business - boarded up windows, suspicious people, decay, trash (and my favorite, signs and barriers saying WARNING LAND MINES) - and you generally have to intentionally ignore those and soldier on before you get into truly deadly stuff.
Hell - I rode my bike through the Balkans recently. I felt fine. Dangerous neighborhoods were always off the beaten path a bit, and easy to spot when you were getting close to one. The local 'gangsters' or other people you just didn't want to
with stood out like a sore thumb - and if you kept your distance and weren't an idiot, you were safe. You could always get pickpocketed, but to be in any real danger you had to look for it.
SO
Level 1 characters dealing directly with Level 20 threats should not happen - due to the Level 20 characters not noticing the Level 1s. They should just breeze on by, in an impressive fashion, and as long as the Level 1s are not idiots, they'll be fine - in the same way a world leader's motorcade will roll through, and you can get really close to watch, but do one idiotic move and highly trained people will take you down.
So, IMO, when Level 1 characters experience the world, they generally start encountering gradually elevated challenges the closer they get to danger - a goblin, five goblins, a dozen goblins, etcetera - and a good sandbox will generally work that way. Those challenges can be terrain that gets more difficult, distances that are more effort, cultural barriers that act as a soft 'buffer' between you and the information or progress you seek, security like walls and warning signs, patrols that get gradually less 'friendly' the closer you get, etcetera.
It's a communication issue. The sandbox style of play requires a lot more of it, and it has to be done well. It's definitely not for every player, and especially not for every DM.