The notion that Allaah was a pagan "moon god" is a misconception. In pre-Isslaam Arabia, although the pagan Arabs worshiped multiple deities, the name "Allaah" was already used to refer to the Supreme Being, who was recognized as the Creator. Many pagan tribes acknowledged Allaah as the supreme God, even though they worshiped idols alongside Him. In fact, they often called upon Allaah in moments of distress, as documented in the Quran:
“And if you ask them who created the heavens and the earth, they will surely say, ‘Allaah.’”
“Unquestionably, for Allaah is the pure religion. And those who take protectors besides Him [say], "We only worship them that they may bring us nearer to ALLAAH in position." Indeed, Allaah will judge between them concerning that over which they differ. Indeed, Allaah does not guide he who is a liar and [confirmed] disbeliever.”
This shows that the concept of Allaah was distinct from the moon god or other deities, and Isslaam came to reaffirm the worship of Allaah alone, without any partners.
The claim that Allaah was a moon god is based on misunderstandings and often promoted by anti-Isslaam rhetoric. Scholars of Semitic languages confirm that "Allaah" is linguistically derived from "al-Ilaah," meaning "The God" in Arabic. This name is not tied to any pagan deity but to the monotheistic concept of God.
As of its inception, Isslaam called for the worship of Allaah as the only God, rejecting all forms of idolatry and associating partners with Him. Prophet Muhammad's message was a continuation of the monotheistic tradition that began with previous prophets such as Abraham, Moses, and Eessa. The Quran repeatedly emphasizes that the religion of Isslaam is about submitting to the one true Creator.
Read The Quraan, which is the word of Allaah, as it is the only accurate source that differentiates fact from misconception.