Can schools educate?
The primary purpose of school is to educate those who attend. Especially where children are concerned, there are secondary purposes of offering care for students during the day and ensuring some degree of health and fitness. For the most part, schools do educate students, but sometimes this is easier said than done.
In general, I believe the answer to your question is yes. Schools offer the explicit teachings of mathematics, language, literature, and science, as well as the implicit teachings of social life. Sometimes it can seem like the learning process is slow or barely moving at all. A student might feel, at the end of the day, like they spent all day in class and didn't learn a thing. Slowly but surely, students do learn!
Some factors can hinder a child's ability to learn, even in a good school with an adept teacher. Children who are undernourished often struggle with cognitive development. Similarly, emotional and mental distress can inhibit one's ability to learn. Children who come from low socioeconomic households are more likely to experience both familial and emotional stress and be undernourished, which hits hard in their ability to learn in school. As has previously been done with developmental disabilities, teachers and school staff can implement programs or therapies to help reduce those obstacles which hinder a child's ability to learn.