Before you start dreaming, the body goes through a paralyzation phase (I'm sure you have experienced that ). Basically, if you know you are dreaming, then you cannot move your living body the same way you do while dreaming. E.g if you punch you wont hit your nighttable

I'm not that experienced on the topic, but I think that the paralyzation might fade some seconds before wakeup. So if you have a nighmare you might find your dune on the floor beside your bed, because you kicked it off a few seconds before you woke up.