There are multiple ways to a sequel for a game that have multiple endings.
Spoilers ahead (obviously).
Case 1: Witcher 2 => Witcher 3
The story of Witcher 2 splits into 2 drastically different paths in the end of Chapter 1: you are either going with Roche and his Blue Stripes or you are going with Iorveth and his Scoia'taels. These groups are pretty much at war with each other, so siding with one of them will make you an enemy (or at the very least untrustworthy) for another.
However, the final cutscene of Witcher 2 reveals that this conflict was nothing but a petty squabble, since there is a major war with Nilfgaard starting soon.
Basically, whatever you did in previous game doesn't really matter and will become a glancing reference or some insignificant bonus at best.
Drakengard: (Ending E) => Nier, (Ending A) => Drakengard 2
C&C: Red Alert: (Soviet Ending) => C&C: Tiberium Dawn, (Alliance Ending) => C&C: Red Alert 2
Both of these examples are a bit questionable canon-wise, but I can't give a better one.
The point is: multiple endings split into different sequels. It's a rare and expensive for developers, but it can be done that way.
Case 3: Deus Ex => Deus Ex 2
Whatever of 3 endings of Deus Ex you might have chosen, all 3 of them happened. How? Well, JC became an avatar for an AI god (Ending 1), which caused a collapse of the Internet on Earth (Ending 2), and The Illuminati used that 'Dark Age' to snatch the control over humanity back in their hands (Ending 3).
Personally, I'm not a fan of this one, but whatever, it kinda works.