Did different ancient peoples learn and acquire knowledge from the scripture of their specific religion(s)?
In the past, I think, ancient people acquired knowledge from the scripture of their religion and then other thoughts came into their minds, like when Aristarchus said, "Had the Sun been the centre of the universe!" as he was a worshipping the Sun god.
What you are referring to is the idea behind syncretism. This is when people from one religion take something from another religion and incorporate it into their own belief system. We see this happening all the time and sometimes it is very amusing. Let me give you a few examples.
In ancient Ephesus, the temple of Artemis was one of the seven wonders of the world. It housed the goddess Artemis, but she looked nothing like a Greek or Roman god. In fact, she was depicted as a many breasted fertility goddess from Anatolia. So, at one point the Greeks took from the surrounding area this imagery of the goddess and incorporated it into their belief system.
Another example comes from the ancient Alexandria where Philo the great Jewish thinker lived. He incorporated Greek philosophy into his reading of the Hebrew bible. So, Moses was akin to Plato. More importantly, his hermeneutical method of using allegory was taken from the best of Greek scholarship in Alexandria.
Finally, even if we look at today. Many religions have taken their cues from commercialism and everything is commodified and sold. We can say that there is an odd mix of religion with secular commercialism in modern religions.