His parents left to Tanzania a muslim country so they cant be escaping one muslim country to another. His family practiced Parsi religion or Zoroastarian which is the same religion as the guy who did the Bourke street massacre in Melbourne. But he was Greek who practiced Zoroastarian.
this is what I found from wiki
As Parsis, Mercury and his family practised the
Zoroastrian religion.
[13] The Bulsara family had moved to
Zanzibar so that his father could continue his job as a cashier at the
British Colonial Office. He had a younger sister, Kashmira.
[14]