The word 'Allah' as a God was well known at the time of the pagan Arabs (and perhaps even more backward in the history).
In fact they even believed Allah to be the creator and sustainer:
If indeed thou ask them who has created the heavens and the earth and
subjected the sun and the moon (to his Law), they will certainly
reply, “Allah”. [...] And if indeed thou ask them who it is that sends
down rain from the sky, and gives life therewith to the earth after
its death, they will certainly reply, “Allah!” (Surah Ankabut, verses
61-63)
They also gave a lip service to the fact that Allah has no partners, by Chanting:
Labbaika Allahumma Labbaik, Labbaika la sharika Laka labbaik(you have no Sharik/partner O' Allah)
, but after uttering the above statement they added something like: "except you who gave {Idol name} power to be a partner"
Moreover, there existed a community among them which was called as 'Hanif' , and they were sincere monotheists and did not worship others alongwith Allah
What made the pagan Arabs Mushriks(One who commits polytheism) was that they worshipped other Gods along with worshiping Allah
And most of them believe in Allah, but commit shirk. (Surah Yusuf,
verse 106)
Ibn Abbas (رضي الله عنه), when asked about this verse, said “their
eman in Allah is that if you ask, ‘who created you?’ they say ‘Allah’.
Their shirk is that they worship other then him.”
The excuse of the jahili Arabs to commit shirk is preserved in Surah Yunus:
They serve, besides Allah, things that hurt them not nor profit them,
and they say: “These are our intercessors with Allah.” (Surah Yunus,
verse 18)
These pagan Arabs believed their Idols(which included dead people, angels, stars, prophets etc) to be intercessors with ALLAH which bring them closer to ALLAH.
Thus it is believed by many groups like the Shia that the Prophet's father and his grandfathers were not pagan and that they belonged to this community of "Hanif"(Monotheists) who were always monotheists to begin with and so was the Prophet pbuh. Hence there is a possibility that the name of the Prophets father was well knowingly given to him in true spirit of monotheism.