Is it valid to modify a student's exam grade if you feel they did not earn it? I am a graduate student who teaches their own class. I have a supervisor who I report to for everything, including final grades. We have a meeting every semester at the end to review our final grades and for my supervisor to see that I did everything correctly.

In my second semester, my supervisor looked through my grades before they were submitted or published.
At the end, she said: “Let’s look at your borderline students.”
She noticed that a student had a borderline C, say 73.5%, which is barely above the passing threshold of 73% for this course, and had us look at his final exam. The student got 66.5% on the exam, and she said to me: “Are you sure you want to pass him?” At the time I was thinking: “Well, the student did earn the passing score.” However, my supervisor kept suggesting: “Are you sure?” I looked up to my supervisor who was the one who taught me to be a teacher, and like anyone at their job listening to their superior, I felt pressured to say yes, because you do what your supervisor tells you to do, and I was told to take off points from his final exam to lower his final grade to 72.36%. The sole reason for this was not to let the student pass. My supervisor also mentioned specifically not to keep it higher than 72.5%, because students will ask for a bump.
So, in the end, I ended up giving him that 72.36%, a C−, which is a failing grade: They cannot move on the the next-level class.

The discussion happened before the grades were submitted or published, so the student never knew he originally scored 66.5% on the exam. There were no other students with borderline scores.

I felt extremely guilty because I knew who this student was; they didn’t do much of the work, they didn’t always come to class, but they knew the topic and did the bare minimum to pass. I went back to my office right after our meeting and was tempted to change it back to a C. But knowing my supervisor, I knew there was a chance I could’ve gotten in trouble because my supervisor might’ve noticed.

I feel extremely bad for doing this, I felt like I was pressured to do this and couldn’t turn back.

Was the supervisor's decision ethical, academically, and legally sound?
Since you ask, specifically, about legality, I'll say that it is unlikely that it would be a matter of criminal law anywhere, though, of course, I can't know the laws of every jurisdiction. But it could well be a matter of civil law and if this were known could easily generate a lawsuit against everyone involved. 

I think that a person would be very hesitant to apply such a "rule" to the child of some powerful person. It depends, I think, on people either not knowing what really occurred or being so powerless as to be completely unable to prevent it. 

But, as I've been saying in comments here, it is a profoundly unethical act and would, in my view be grounds for at least a reprimand, and even termination as an act of moral turpitude if repeated. It turns what should be a well determined process in to a form of chaos where we are just at the mercy of the powers. 

An instructor needs to set a standard before the course begins and needs to make that public. You can make it as hard as you like and you can interpret it as strictly as you like, but you can't deviate from it to the detriment of an individual. I have no complaint about generous interpretations as most of us, I hope, consider generosity to be laudable and to believe that students can learn and improve. 

I won't condemn you personally, however, since you may have had no agency here and may be as much a victim as the student involved. But I will condemn the professor, who should, at a minimum be reported to the dean for this behavior. Especially since the course is a gateway course and changing their grade to make it failing when it was not also denies them the opportunity to go on and, one hopes, improve. 

It was especially pernicious, here, that the induced change in the average was set not only to unethically push the student below the passing grade, but further down so that it would be less likely they could appeal. 

My advice to you personally, is to find a better mentor as soon as you can. This person is teaching you to do harm. 

And, I don't know how you can make it up to the person you damaged. It may be too late, even to request a grade change. But the dean should be informed and if it is only you that knows that the professor is behaving this way, it is probably your responsibility to so inform them. I won't suggest that you do, of course, since it might have too adverse an effect on your own career, but there is an imbalance in justice that hasn't been corrected.