One student grading other students' assignments in the same course?
A student grading other students in the same course is unusual, but certainly not illegal.  As to whether it is inappropriate, I would consider two cases:


Sometimes professors ask all students to do part of the "teaching" responsibilities for a course, whether that be lecturing, grading, creating course notes, etc.  The theory of this is that it forces a deeper engagement with the material, and may help prepare further skills.  When grading or similar is done by a student or other students for a pedagogical reason like this, I see no problem, as long as the professor takes into account the potential for quality variation.
If an individual student is simultaneously a class member and a TA/grader, that is much more unusual, and generally a bad idea.  In this case, the pedagogical value of having all students engaged with the process is not there to balance the expected decrease in grading accuracy and quality.  There may be certain unusual circumstances where it is appropriate, and a professor can, in fact, organize things to compensate for the issues that you raise, but in general I would be highly dubious about this practice.