Can I replace my mountain bike's back wheel quick release? I was wondering if there is a way to replace my bike's rear quick release with something which would be harder for someone to steal. 

At the moment all that someone has to do is pull the leaver and they can take my wheels, so I just wanted something which is safer and can be opened when needed with something like an allen key or something.
Yes. There are many, many products exactly as you describe, with mechanisms ranging from simple hex keys to actual locks. A web search for "theft proof quick release", "anti theft skewer" or something like that should find some of them.