Can we have to repeat the course for refusing to redo an assignment?
Yes, they CAN do that.
If it results in your failure of the course, sure. For example, some courses calculate homework grades, but ALSO require the completion of a final or a final project. If the assignment you didn't do is REQUIRED to pass the course... then not doing it is reason enough to fail the course... If the course is required for graduation, then you would have to repeat the course.
In the lower grades the teacher can refuse to administer the semester and quarterly test if you have not done the assignments which means not only what you have to repeat a course but you may find yourself suspended