Freknu's post is accurate. Additionally:
1) How could this happen to me?
This refers to a
general situation. It might be in the past, but your question is not only about the past: you want to know why this might happen to you again or in general-- "Why me!?" you ask, referring to who you are as a person or what you do in general. (This would be a really weird question to ask if you just changed your life completely by getting a new job, moving to a new country and changing your lifestyle in general. It implies there is something consistent about you in the past and also now.)
Additionally, this does not NEED to refer to the past. It can, but only indirectly. It's general. (This is not a "present", but a habitual/general verb.)
2) How could this have happened to me?
This specifically happened in the past, and you want to know how. It's possible this is still relevant, but you are focusing on the one event (or maybe several) in the past specifically.