I can't remember every detail, but supposedly the clownfish secretes a special slime coating that sort of numbs the stinging cells of the anemone and causes them to not fire. The anemone wouldn't hurt it if it had control of it anyways because clownfish help them out a lot.
From my understanding anemones can't control they're stinging cells, so if the clown didn't have the coating it would get stung.
And what a lot of people don't know is that not all anemones host for clowns. some are actually called clown assasinators. Some anemones don't even come from the same region as most clowns and will eat them if they come near enough.
I'm tired of getting pointless messages. If your going to start a conversation or ask me something, keep up with it.