I have read that the Grand Mufti of Jersualem had a positive relationship with Hitler but that Muslims from India also fought with the Brits. I imagine that most countries were thinking of their own gain, especially since some Muslim countries were under Western control. Was there a general consensus on the war from Muslims at large, including civilians? I find it interesting since the Nazi ideology clearly clashed heavily with Islam but the British weren't angels with their colonies either.
I can speak to the greater Middle East more so than the rest of Muslim world (e.g. Greater India, Malaysia, etc.) which is that many of the countries of the Middle East were Axis-leaning, resulting in direct intervention by the allies in several of them.
In 1941 the Russians and the British jointly invade Iran to depose Reza Shah and install his son, Mohammed Reza. They also arrest and intern Iran's future Prime Minister, General Fazlollah Zahedi.
Also in 1941 there's a coup in Iraq which brings to power a pro-German government. This prompts a British invasion and re-occupation of the country in a brief war.
In 1942 you have the Abdeen Palace Incident in Egypt in which King Farouk is threatened with being deposed if he doesn't fall into line. He did, and was basically left a broken man.
Syria and Lebanon fell under the control of Vichy after the fall of France. The allied invasion of Syria and Lebanon is little studied I suspect because it was so embarrassing— the Vichy army actually resisted quite fiercely. I'm less familiar with popular sentiment of the Syrians and Lebanese, but the Free French under DeGaulle promised independence for Syria and Lebanon in 1941. The allies occupied the countries after the invasion campaign and the French tried to go back on their word, in Lebanon by arresting several leading politicians in 1943, but relented and Lebanon became independent on November 22. The French eventually left Syria in 1946.
Turkey remained neutral until February 1945, but was de facto pro Allies. Their neutrality was believed to be more valuable than if they had explicitly declared war