The Demon Headmaster by Gillian Cross
When Dinah is fostered by the Hunters she thinks her biggest problem will be fitting in with her foster-brothers, Lloyd and Harvey. However, once she starts at her new school it's clear that there's more to worry about. All the children, apart from a handful including Lloyd and Harvey, are too well-behaved-robotic almost-and oddly keen to please the creepy headmaster. The three children set out to discover the nature of his influence over everyone ...but then Dinah finds herself saying and doing things she has no power over. Soon they uncover the headmaster's wicked plan. Controlling the school is just a practice run. He has set his sights on dominating the entire nation! The children must foil him before he succeeds ...but with Dinah under his spell they've got a challenge on their hands.