Happen is the infinitive/present form of the verb; happened is its past/past participle form.
So What happened? is the form you would normally use to ask what occurred in the past.
What was happened? would be a past passive and can't be said in English, unless you're inventing a new transitive use of happen.
And What had happen? is not a possible construction; you must ask What has happened? (if for instance you are arriving at a scene of confusion) or What had happened? (if you are trying to find out what happened before some event in the past).
What did happen is possible; you would use this if people have been denying that this, that or the other happened and you want to steer the conversation away from what did not happen.