To flog is to beat or hit, especially with a tool like a stick or rod. A cruel trainer might flog an unruly horse with a whip.
When you flog someone, you beat them as a way of punishing or controlling them. In the old days, teachers were allowed to flog misbehaving students, and it wasn't uncommon for parents to flog their children as punishment. In fact, the word flog first appeared as school slang in the late 1600s — it's thought to be a shortened form of the Latin word flagellare, "flagellate," or "whip."