Spanish Prime Minister Mariano Rajoy was punched in the during an election event in his home region of Galicia in the northwest of the country.