Do journals allow me to modify contents of a paper? Suppose I sent a research paper to a well reputed journal. I try to prove a novel theorem in my paper using some lemmas. What if the reviewers find that the theorem is correct but some part of the proof or few lemmas I wrote in the paper are erroneous or not up to the mark? I mean cases where the error is not significant, but exist because I am a beginner to the field. 

My question is will they ask me for a correction and wait till I send it to them or will they identify where I went wrong and help me in publishing? Will they simply reject the paper because the proof is amateur ?
If the reviewers feel that the paper generally has merit, but is in need of certain reasonable corrections or revisions, they will often write a list of specific changes or improvements that are needed, and recommend acceptance subject to those revisions.  This is what people mean when they talk about getting a "minor revisions" or "major revisions" decision on their paper.

Another possibility is "revise and resubmit", where the reviewers aren't convinced whether the paper has merit, or if the errors are fixable, but they explain their concerns and are willing to take another look if you're able to fix the paper to address them.

If they doubt that the paper can be salvaged, or if they don't think the results are interesting enough even if they were corrected, or the paper is generally not up to an appropriate level of rigor and clarity, it'll be rejected.  In this case they may not give you very detailed feedback.  After all, their goal is to help get good papers published, and if they don't think your paper is ever going to get there, why should they spend time on it?  

Generally, it isn't the reviewer's job to help you write a good paper, and you can't use the peer review process as a substitute for your own learning.