Sandbox is an environment where you can experiment and take risks without any danger to yourself, or to anything outside the sandbox.
It's based on those little areas for small children in playgrounds, which are full of sand, so that toddlers and small children can play and fall without getting hurt. So as a metaphor, it can be used for any safe environment where you can go, do something silly or risky without any harm to you or others, physical or otherwise (to your reputation, for example). The implication is that when you exit the sandbox, then whatever happened in the sandbox has no effect.
It's also used in software: a program which runs in a sandbox runs in a "protected environment", so that any changes that the program makes, are restricted to the sandbox. Therefore any viruses, bugs, or crashes would affect only the sandbox, and not the complete computer. There's even a web browser which runs along this principle (called "sandboxie"),