>>57917537I was actually thinking about this today. Weird how that keeps happening. My idea was that Red and Ash were both kids from Pallet town, and Red was one of the trainers who got a starter from Oak the same day Ash did. As for the rival, I had two different possible ideas.
Ash, Red, Green, and Blue/Gary were the four trainers who all got their starters that day. Ash still considers Gary a rival, but Gary never actually battles or pays attention to him much in the anime. That's because Gary is actually in a rivalry with Red, who Ash never actually meets. Ash still loses in the Indigo League while Gary goes on to fight Red for the title and loses. Then Gary's normal anime + game story plays out. He ends up studying to become a professor AND eventually becomes the viridian gym leader. Very little has to actually change for Red and Ash to exist together, the only thing incompatible with them is Gary/Green.
Alternatively, and a bit more of a 'big' change, Green and Gary are BOTH Oak's grandkids. Maybe brothers, maybe cousins. Either he and Red (and Blue) started their journey's earlier, or they started at the same time and it is just never brought up. This allows for Gary and Green's stories to remain true.