From what I could gather those with a strong enough will could make a wish become reality. Ayaka and her friend wished to escape and Hiro wished to save Tokarev. Hiro failed in her wish as she ended up killing Tokarev, this meant that she couldn't leave. The Public Commitee member and other students probably couldn't leave because although they wished too their resolve wasn't strong enough. The other students couldn't leave because Tokarev manipulated them into losing their will like Ayaka's other friend.
Ayaka and her friend were able to escape because they really wanted to leave, her friend because she was scared of the place after the beating and possible rape and Ayaka because she wanted to escape with Hiro. However Hiro could not leave because of he failed wish.