No, a charmed creature cannot attack or otherwise harm the charmer. The Charmed Condition states that the affected creature cannot target the charmer with harmful abilities, magical effects, or attacks.