Can an external stimulus change the way your dream ends? I sometimes have the experience that because of a thunder or some other kind of loud sound my dream ends in a way that seems to match with the loud sound. For example, the loud sound of a nearby thunder translates to something making a loud noise in your dream, after which you wake up.
I don't know any scientific evidence of it, but I personally have experienced it many times. I have come to think that it is due to the decreasing depth of sleep. You may know that sleep progresses through different phases. I've read that you only dream during the light sleep phases , or at least you remember to be dreaming during theese phases.
Hearing sound doesn't affect the end of your dream , your brain reacts to the sound with including it in it's own way to your dream at anytime , you just think it's the end of the dream because in that case it wakes you up but your brain does this all night long !

I've already head my alarm ringing in my dreams and it took me several minutes to find out it was realy time to awke up , and not just a background music !

Sorry if it's not scientific enough for you but it seems pretty "normal" to me ^^

EDIT : It seems like people are still trying to prove it but they're convinced it's true : Check this studies results

During the study they observed an impact but due to their lack of technical language the subjects couldn't describe with enough details the impact of internal stimuli on their dream , but new tests will be done with subjects trained with technical language.