Let's break this into two parts.
Safe? Doing that is only a bit more safe than walking with traffic in the middle of a busy freeway. That is a terrible idea. You can get electrocuted at any point in the line. You can electrocute other people in the line. You can electrocute animals. You can electrocute the entire world. Don't do that.
Doesn't fall off easy
Okay. If you stick a piece of wire in an outlet, what's holding it in? It's just a wire. And, by how often my USB cord (with a latch) slides out of my phone, I can assure you that it will fall out.
Ways to do what you want
Luckily, there are a few ways to do what you want. I've given them each a "safety score" (ϟ) between 1 and 5 as well as a "lifehack score" (★) between 1 and 5. 5 is the highest in both cases.
- Electrical Tape (ϟϟϟϟ, ★★★★★☆)
For this lifehack, you're going to want to take all of the wires and lay them out, Tape up the wires to each other. Then, carefully jam two ends into the wall. Make sure the other two ends aren't touching, though.
- Electrical Tape + Outlet End + Receptacle (ϟϟϟ, ★★★★☆)
For the Junction Box trick, you're going to want an outlet end, a receptacle, and a bunch of electrical tape. (Solder is optional and makes it more reliable).
- Get an outlet end from a broken appliance. Trim the wires so you have some leeway.
- Attach your outlet end to the wires. (Solder them.)
- Tape it up.
- Follow Electrical Tape rules.
- Attach the other end of the wires to a receptacle.
- Put that receptacle in a junction box.
- Enjoy your homemade extension cord!
- Electrical Tape + Bought Outlet End + Receptacle (ϟϟ, ★★☆☆☆)
- Get an outlet end from your local hardware store. They have screws in them.
- Follow above steps.
- Enjoy your homemade extension cord.
- Extension Cord (ϟ, ☆☆☆☆☆)
Go to the local store and buy an extension cord.