Dodging Cog attacks in Toontown depends on your setup, but it's usually done with either the Ctrl key or the mouse button.
Try both to see which one your controls are mapped to, and you'll be sidestepping those gags in no time.