Surely the character knows this will happen through her training. Why wouldn't the hatch have a better mechanism such that astronauts do not run the risk of flying into space.
Of course she knows it will happen. There is (possibly) pressure on the inside and certainly none at the outside: it is physics basics, no training needed.
But I doubt that Ryan Stone's training dealt with this kind of an emergency situation. She has had six months of training according to the dialogue in the movie. I am no expert, but six months sounds rather minimal to me. It could be enough though, considering she is "just" a scientist added to the crew to install/setup some hardware. The emergency training for this kind of debris catastrophe, if at all, would be for the commander, the captain and mission control.
There is no need to: There is no risk if Ryan would have secured herself with the carabiner hook (as she did when she unscrewed the connectors between the ISS and the ship), and/or if she would not have been on top of the hatch but in front of it instead. But both times she was in respiratory distress and simply did not think of it in the panic.
The technology in "Gravity" was largely (but not exclusively) based on real-world technology. The film featured consultants from NASA, former astronauts as well as shuttle and space engineers.
The short answer for why the capsule in Gravity uses an explosive hatch is simply because that's what is used in reality.