One of Guatama Buddhas appellations is 'Teacher of the Devas'. I quote from that Access To Insight article (which is the Therevada perspective, & refers to the Pali canon):
The Buddha has directly seen the origins of Maha Brahma and
understands what it requires to be reborn in his world. In the
Brahmajāla sutra (DN 1) the Buddha describes how a supposed
Creator God came to believe himself omnipotent and how others came to
rely on his sovereignty. His description was based, not on speculation
or hearsay, but on his own direct knowledge. The Buddha explains that
when our world system disintegrates, as it regularly does after
extremely long periods of time, the lower sixteen planes are all
destroyed. Beings disappear from all planes below the seventeenth, the
plane of the Abhassara gods. Whatever beings cannot be born on the
seventeenth or a higher brahma plane then must take birth on the lower
planes in other remote world systems.
Eventually the world starts to re-form. Then a solitary being passes
away from the Abhassara plane and takes rebirth on the plane of Maha
Brahma. A palace created by his kamma awaits him there: "There he
dwells, mind-made, feeding on rapture, self-luminous, moving through
the air, abiding in glory. And he continues thus for a long, long
time." After ages pass, he becomes lonely and longs for other beings
to join him. It just so happens that shortly after the brahma starts
craving for company, other beings from the Abhassara plane, who have
exhausted their lifespans there, pass away and are reborn in the
palace of Brahma, in companionship with him.
Because these beings seemed to arise in accordance with the first
brahma's wish, he becomes convinced that he is the almighty God: "I am
the Great Brahma, the Vanquisher... the Lord, the Maker and Creator,
the Supreme Being." The other brahmas, seeing that he was already
present when they took birth in his world, accept his claim and revere
him as their creator.
Eventually this misconception of a Creator God spreads to the human
plane. One of the other brahmas passes away and is reborn here. He
develops concentration and learns to recollect his previous life with
Maha Brahma, but none of his lives before that. Recollecting that
existence he recalls that Maha Brahma was considered the "father of
all that are and are to be... permanent, stable, eternal." As he is
unable to remember further back, he believes this to be absolute truth
and propounds a theistic doctrine of an omnipotent Creator God
I am honestly surprised more Buddhists don't know about this account of Buddha teaching Maha Brahma.
You will likely also find the pali Brahmajāla sutra interesting for it's sections '18 beliefs about the past' and '44 beliefs about the future'.
You should read about Buddhist temporal cosmology for the origins & expected end of this particular universe or realm.