Optimus is Beast Wars is Optimus Primal .. Optimus Prime is a direct descendant of him. Recall Beast Wars occurred when dinosaurs roamed, so it was some time ago
Not quite on either count. Beast Wars takes place on prehistoric Earth (though the show doesn't make it totally clear it's Earth until some time into the series), but they get there via a wormhole/space vortex thing and time travel shenanigans. the Maximals and Predacons are actually distant descendants of the Autobots and Decepticons from some indeterminate amount of time after the present day events of the original Transformers content. (this is important for significant plot reasons towards the end of the second season of the show)
The timeline is something like
9 million years ago - the great war of Autobots vs Decepticons starts. Optimus Prime is "born"
4 million years ago - The heavy hitters from both factions leave Cybertron. They fight in space and end up crashing on Earth, with the Autobot ship (which has both sides on it since the Decepticons boarded it during the fight) embeds itself in the side of a mountain. The crash knocks all of the Transformers offline and as well as the ship's main computer
Present day (1984 given the timeframe of the cartoon) - the mountain's dormant volcano aspects stir to life. The eruption jostles the ship computer to life and knocks a Decepticon into range of its repair functions (the ship then unknowingly repairs the Decepticon presumably because it's too scrambled to tell who's who at that point). After the rest of the Decepticons are revived, Starscream, being a massive idiot, shoots the ship from the outside, intending to "say goodbye" to the Autobots and bury them in more rubble. Instead all it does is knock over Optimus and let him get repaired/reactivated so that he can do the same for the rest of the Autobots.
2005 - The events of Transformers: The Movie (the 1986 cartoon one) happen
2006 - The events of the 3rd season of the Transformers cartoon happen.
Some indeterminate number of years in the future - The great war between Autobots and Decepticons is over. Facing a fuel shortage, the factions are largely reformatted or freshly built into smaller, more energy efficient bodies. The factions then rechristen themselves as the Maxmals and Predacons respectively.
Still further after that - Beast Wars Megatron (who has named himself for the G1 character) swipes an important artifact from Cybertron and flees into space. He is chased by a "science vessel" captained by Optimus Primal (who is not in any way directly connected to Optimus Prime. Nor is he a "Prime" in the same way that Optimus/Rodimus was. It's presumably just a venerated name that he adopted or was given. The pilot of the show makes it sound like everyone re-names themselves after they format into their beast forms, which makes sense since almost everyone has a name that specifically references the alt mode they end up with, but that is mostly forgotten afterwards and it's treated as if each bot always had the name they have even if it makes no sense because there'd be no gorillas, rhinos, pterodactyls, rats, cheetahs, spiders, or anything of the sort on Cybertron). The two ships fight and are sucked through a time vortex, sending them back about 4 million years into Earth's past where they crash on the prehistoric planet. Again, this is very significant to a plot reveal late in season 2 of the show.
I'd say more but I don't want to spoil everything for anyone who hasn't seen the series and might want to watch it because as I've said, it's worth watching and is one of the better storytelling efforts in Transformers history if you can get over that the CG is primitive and dated since it's from 1996-2000 and was made for classic SD TVs in 480 resolution. The stuff that this is plot relevant to is easily the best stretch the show has.
The whole series is available to watch for free without an account on Tubi
Honestly the first portion of season 1 is kind of a slog because it's a bit more kiddy and silly but it also has some necessary character stuff and plot development. It kind of kids into high gear around "The Trigger" 2 parter, which is episodes 16 and 17 of the first season (which ran for 26 episodes. The next two seasons were half-length at 13 episodes apiece). Then it gets
really good in the last 3 episodes of the first season before transitioning into the second one.
yes, I am a giant nerd for knowing all of that. Transformers is kind of my "thing".
Actually on a dedicated Transformers forum I've spent the last couple of years watching every episode of every Transformers series for review and discussion with some other posters there. Right now we're in about 2010 or so and have covered I think just over 500 episodes of material (which isn't even the halfway point of the franchise
)
Other secondary point is that there are no known direct lineages between any Beast Wars character and a G1 namesake or thematic counterpart. The only connections that come up are 1) as mentioned BW Megs named himself for G1 Megatron (mild hot take: I think Beast Wars Megatron is the far superior version of the character. In fact I think he might be the best Megatron across any iteration of Transformers, period) and 2) Rattrap makes a comment like "what in the name of my Great Aunt Arcee..." at one point, though it's highly likely he's just being a flippant smartass as is his usual mode and he's not actually familially related to G1 Arcee.