Tom Sawyer is indeed afraid of Aunt Polly, though that still doesn't stop him from getting up to all kinds of mischief. She's quite a formidable woman, and in common with most adults of the time, she thinks it acceptable to use physical punishment to enforce discipline. When she catches Tom helping himself to some jam in the pantry, Polly doesn't hesitate to grab hold of a switch to give her errant nephew a good hiding. And although Tom manages to escape this time, we're left in no doubt that this is a normal method of punishment in Aunt Polly's household.
Yet Aunt Polly is a kind, patient woman, and she can't stay mad at Tom for too long. She's also very intelligent and understands that sometimes it's necessary to spare the rod. So when Tom gets caught playing hooky, Aunt Polly decides to punish him by making him whitewash the fence (another punishment which he manages to escape).
Ultimately, this is a battle of wills which Aunt Polly is destined to lose. At the same time, Tom still goes out of his way to avoid being caught by her. This indicates that he's still afraid of his aunt to a certain extent. When he comes back home from swimming when he should've been at school, for example, he comes up with an elaborate story to explain his damp hair. If he really wasn't afraid of Aunt Polly, Tom wouldn't have done that. He'd have made no effort whatsoever to pretend that he hadn't skipped school that day.