Is it allowed in Islam to convert a church to a mosque after winning a war as was done after the Ottomans won the war in Constantinople and turned Aya Sophia cathedral into a mosque?
During the government of the Prophet Muhammad (SAWA) and Ameerul Mo'mineen (AS), they did not convert any church into Mosque. It is left to the people of the area whether they want to remain Christians, so, church will remain as a church for them, but if they opt to be Muslims willingly and want to use the place as a Mosque, they are free to do that.
Islam does not confiscate the religious places of other communities.
Wassalam.