What is the difference between 試験に受かる and 試験が受かる? It seems that the first one means "to pass an exam" while the second one is more like "passing exams" (really not sure about it).
In which cases would に be used together with an intransitive verb?
(The question was already essentially answered in comments by Chocolate and me, but I am posting an answer as an answer.)
To answer the question literally, 試験に受かる (to pass an examination) is grammatical, but 試験が受かる is not grammatical, as Chocolate stated in her comment.
But a more interesting part comes from your logic based on which you thought that 試験が受かる would be grammatical in the first place. Although your logic was unclear to me until I read your comment in response to Chocolate’s comment, once I understood the logic, it perfectly made sense.
Your logic: The event ドアを閉める can be described from a different perspective by saying ドアが閉まる. Similarly, it must be possible to restate 試験を受ける as 試験が受かる (*). But there is also an expression 試験に受かる. What is the difference between 試験が受かる and 試験に受かる?
Alas, the sentence marked with (*) above is false! 受ける and 受かる may look like a transitive-intransitive pair just like 閉める and 閉まる, but they are actually not, and we cannot restate 試験を受ける as 試験が受かる. Also note that 試験を受ける (to take an examination) and 試験に受かる (to pass an examination) describe different events, and in both cases, the subject is the person who takes/passes an examination.
The only other “false” transitive-intransitive pair like 受ける and 受かる that I can think of is 分ける (to divide) and 分かる (to understand; often written as わかる). The correct transitive-intransitive pair is 分ける and 分かれる.