Using allegory as a moral proxy is fine. And even a really great way of making complex or dry topics more approachable.
What is not ok is when you take allegory as literal, such that you actually believe that there is a sky wizard who will punish you for showing your hair in public. What is incredibly fucked up is when you then project that literal belief to a prescriptive action framework which commands you to murder heretics.
Friendly reminder that if your ideas aren’t complete shit then they can withstand some challenge.