Is the professor allowed to force all of his students to retake the final
There's nothing illegal about it as far as I can see, so we can get that out of the way first.

As to fair, if there are still regularly scheduled class days, they can be used. If the exam is available online originally and planned to be made online again, then given a large enough testing window to account for other exams, I don't see a huge problem.

Now, if for whatever reason the exam would need to be retaken on campus or during a specific small window of time that students may have conflicts with, then the most logic solution in my mind is to make the final optional, or to cancel it all together. 

However, the professor will have a fair amount of freedom to decide how to deal with the situation and will undoubtedly have consulted with their department head to make sure the solution seems reasonable (at my university we have to get our dean to approve any exam time outside the standard exam schedule). As a professor, I would personally consult with the department head if for no other reason then to give him a heads up on something that has the potential to generate academic grievances.

If your friend feels the solution is unjust, they should begin an academic grievance process, which will be outlined in the student handbook or similar. The first step is normally contacting the professor to discuss the issue.