Apparently you can train yourself to have lucid dreams.
If while awake upon entering a room, you switch the lights on and off, look at a clock and read something.
This way you get into a habit of doing this so eventually you will end up doing it in your dreams, and so i am told in your dreams, light switches don't work, clocks don't work and text appears scrambled, this way you know its a dream and then you can do what you want.
Some even think if you practice playing the guitar in your dreams you will get better at it while awake, no idea if there is any truth behind it (obviously you can't learn a new instrument in your sleep just improve on current skills)