Dozens of students have been arrested in South Africa after protests for free university education turned violent in the country.