I am unsure if there are actual legit Gods in One Piece's world, but it seems there's some kernel of truth to it.
Unless it was like the Gods were just the most powerful people of their time and the Sun God was a upstart commoner. And then they and the other "Gods" died and were replaced by the World Nobles.
There is only one God - Sun
Rest are rulers
Here it is
World one - reference to the world ruled by Ancient Kingdom
"
On Earth there is flame. mankind engulfed in desires"
"Enslaved prayed and Sun God appeared "
This para is referencing to rule under Original King of Ancient Kingdom. It was evil. Desire here refers to being the King of the World.
This led to rise of Joyboy and Nika - first pirate and Sun God giving hope to those who were enslaved.
"
Sun god appeared. Deity of Earth is enraged. Together with serpent of hell flames engulfed the world in darkness"
This para is referencing to how original king of ancient kingdom got furious seeing rise of Nika.
Serpent of hell flames is either a zoan or ancient weapon.
And, there was a big war between Nika and God of Earth - Ancient kingdom king
Connection with present - BB fits this theme. Has yami (darkness, has desire, is a D, will get hands over serpent of hell flames (ancient weapon or zoan df), and we know he's linked with void era so his ancestor was the original evil king of ancient kingdom.
World 2 - Rise of World Government
"In emptiness, there is breath"
This is referencing to situation after War between Nika and Ancient kingdom ruler - everything was destroyed.
But someone came out as a new breath or hope - False hope - IMU
"
King of forest send demons
Sun god did nothing but spread seeds of war"
Here king of forest is ImU. He send his demons to spread agenda against Sun God and that the Sun God is harbinger of war and destruction.
It is classic politics to encash upon the destruction which happened due to war between Sun God and Ancient kingdom ruler.
This led to unification of original 20 kingdoms against Nika.
But this was far from reality.
"People of Moon saw a dream"
D clan under Nika wanted freedom from slavery and freedom.
But D clan and Nika were branded as evil who spread wars and needs to be stopped.
"
Men became gods by slaying the sun"
Sea God enraged.
This is perhaps referencing to how original 20 kingdoms under IMU rallied against Nika to defeat him.
Connection is obvious
King of forest - ImU
Men became Gods - Celestial dragon
Demons - Elders and perhaps God Knights
World 3 - rule of world government
And, ongoing events since series started which will see rise of Nika again