Is it correct to replacing "if clause" by "main clause" in sentence? for example:
If I study, I will pass the exams.
I will pass the exams, if I study.
You don't exactly replace it, but you switch them places. The meaning does not change, but in the second example you should remove the comma.
I will pass the exams if I study.
When the main clause precedes the if-clause, we don't use a comma.
Yes, both forms are correct. The if clause can be first or last, without changing actual meaning. In your examples, having if first has a neutral connotation. You are stating a fact. Moving if to the end tends to sound more dramatic, as though you are intentionally casting doubt upon the likelihood of studying. The actual meaning doesn't change, though, just how people might interpret it.