I hope this isn't too broad or an unanswerable question, but heres a little back story on why I'm asking this:
So last summer I started reading a bit of Genesis for the first time from the Torah. Now this particular Torah was in both English and Hebrew and had an extensive compilation of footnoted commentary from Jewish and Rabbinical scholars stretching back hundreds of years. I don't have the passage in question in front of me but from what I remember it said basically this: the Torah was written as a book of laws, as such the opening of Genesis involving the creation of the Earth is not to be taken literally, but as an expression of God's supreme authority over the universe and the laws he's passed down to the Jewish people.
So given this, did anyone take the Genesis story to be literally true? Would Christians in the first few centuries of C.E. be taught this sort of interpretation?
This is a good question that has an unsatisfactory answer: yes and no. Similar to religious groups today, there was no single form of Judaism in the ancient world. There were groups that we would identify with todays terminology as liberal, conservative, cultic, terrorist, and everything in between. That being said, we do have some texts that shed light on your question.
The most in-depth author who addresses this question is Philo of Alexandria, who lived from 1st c. B.C.E. - 1st cc. C.E. He wrote an apology / commentary on the Torah, including Genesis, melding the text of the Septuagint (Greek translation of the Torah) with Greek philosophy (mainly Middle Platonism). Philo, however, was from a very wealthy family (by his own account), so he is a view into the aristocracy of Alexandrian Jewry at the time.
He takes elements of Genesis as actually happening, but other elements he offers an allegorical interpretation. For example, when discussing God as walking with Adam and Eve in Genesis, he says that God was not physically there but the text actually means that it was like God was there. To meld Jewish and Greek philosophy, such adaptations were required.
Then we have another glimpse into a different type of ancient Judaism: the Essenes of Qumran. These were only a single group of Essenes and they likely disagreed with other groups. But in some of their texts recovered from the caves next to where they lived (the Dead Sea Scrolls), we read texts such as Jubilees, which retells the story of Genesis in a very specific way. For Jubilees, the text centers around the perfect number seven and the significance of using the solar calendar as opposed to the lunar calendar used by the priests in the Second Temple.
So some groups did take Genesis literally, but they took their version of Genesis literally. Other groups, such as Philo, believed Genesis was true, but only if you read it the correct way.
As for early Christianity, we see a similar development in Origen (2nd c. C.E.) as in Philo. Origen argued that Scripture (there was not a closed canon of Scripture by this point, so this term is open to debate) was layered with many meanings. It is like an onion, waiting to be peeled. There is a surface meaning but also an allegorical meaning for those who know how to read the text properly. Origen wrote a commentary on Genesis, but like most of his works, it is no longer extent.
Augustine (354-430 CE) wrote a work titled A Literal Interpretation of Genesis. It's ironic however because his definition of literal is very allegorical compared to the literalists of today. So don't let the title of the book give you the wrong impression. Two quotes from the book.
we should not rush in headlong and so firmly take our stand on one side that, if further progress in the search of truth justly undermines this position, we too fall with it. That would be to battle not for the teaching of Holy Scripture but for our own, wishing its teaching to conform to ours, whereas we ought to wish ours to conform to that of Sacred Scripture
Usually, even a non-Christian knows something about the earth, the heavens, and the other elements of this world, about the motion and orbit of the stars and even their size and relative positions, about the predictable eclipses of the sun and moon, the cycles of the years and seasons, about the kinds of animals, shrubs, stones, and so forth, and this knowledge he holds to as being certain from reason and experience. Now, it is a disgraceful and dangerous thing for an infidel to hear a Christian, presumably giving the meaning of Holy Scripture, talking nonsense on these topics; and we should take all means to prevent such an embarrassing situation, in which people show up vast ignorance in a Christian and laugh it to scorn. The shame is not so much that an ignorant individual is derided, but that people outside the household of the faith think our sacred writers held such opinions, and, to the great loss of those for whose salvation we toil, the writers of our Scripture are criticized and rejected as unlearned men.... Reckless and incompetent expounders of Holy Scripture bring untold trouble and sorrow on their wiser brethren when they are caught in one of their mischievous false opinions and are taken to task by these who are not bound by the authority of our sacred books