Does the moderator forbid it? If it's not obvious from the game that a player is clearly not playing the role they're pretending to be, and it's also not clear whether they definitively belong to another faction, then it's acceptable.
Punishing both sides for revealing roles is excessive; forbidding the Mafia from lying when their survival often depends on it is also excessive.
Punishing only the town for revealing roles is foolish for the reasons mentioned above, but it's better than nothing.
However, in our games, only Tox reveals roles; the others play fairly.
Is it okay for a team to "modkill" a player who, during the day, supposedly revealed a Mafia member as a townie to gain an advantage? If someone is so bothered by reveals (even if it's just one player, haha), then they can be punished through external methods: sanctions or being excluded from the next n games, but not by "modkilling" or issuing warnings during the current game.
Don't mix everything together. In evidence-based Mafia, you can use other methods to deal with negativity: framing people with false evidence, using night actions or skipping actions, etc.
The issue here is different: the town should never be allowed to give obvious hints about their roles – this is what really makes it difficult for the Mafia to figure things out.
sanctions or being excluded from the next n games, but not by "modkilling" or issuing warnings during the current game.
there's a huge difference between revealing and pretending

Барон "Vampires"
Отдай свои прошлые сны,
В сомненьях себя обрети,
В бешеном танце душа кружится!
Не думай, что будет потом,
Здесь и сейчас мы живем,
Стань хоть на миг сам собой, слышишь!