The simulation would have to "glitch". That is, a bug in how the physics of the simulation work such that it becomes apparent that there are no true principles, just the "appearance" of such. Furthermore, this glitch has to expose some sort of exploit into the substrate itself (the computational element of the higher level reality) which would allow some access to execute raw commands on the substrate. However limited that might be.
With such a beachhead, intelligent simulation participants would then be able to escalate their privileges. While this would give them what amounts to "magical powers" in the simulation, it's difficult to imagine a scenario where the substrate is perfectly sandboxed from other processes in higher level reality.
At this point, there is even the potential for escape into HLR.
Of course, none of this is simple. And it's quite possible that the participants of the simulation experience simulated reality at such a slow rate that they can never react quickly enough even if a glitch manifests. If someone in HLR notices that they are experimenting with glitches, that can be fixed before they learn anything. This might be true whether we posit a rather crude simulation where the people are just strapped into VR equipment with science fiction robots harvesting their electrical power, or if it's much more sophisticated and the participants are nothing but data themselves.
In the crudest example (similar to the Matrix), there are likely some things that can't be properly simulated. For one, there's more than one participant in the simulation, and the people still have real bodies (or at least real brains made out of meat). They'd find it impossible to simulate things like light speed time dilation among multiple participants if those participants are allowed to communicate both before and after that event. (But, there are simpler countermeasures... disallowing time dilation altogether, or MITMing the communications after the fact.) There are only a few phenomena extreme enough that this becomes problematic for them (given the laws of physics of a universe similar to ours).
But if there is only one participant, or if they are simply data constructs, everything is simulatable in principle. At that point, they have to actually make mistakes for the glitches to manifest. And if a simulant did notice, they can always start over from scratch once they fix the problem.
Personally I am a fan of Egan, who in his fiction supposes that such simulated universes may be self-bootstrapping, and that there is no higher level reality at all. They are their own substrates (which is similar to what Wolfram himself has said, though many people think him a crank).