In Revenge of the Sith:
Anakin and Obi-Wan make it to the command deck of Dooku's ship and Palpatine urges Anakin to kill Dooku. Anakin has every chance to see the look of surprise and betrayal on Dooku's face before Anakin kills him.
Along the way, over the next 20 years, if Anakin didn't know it, he'd have more than enough of a chance to learn that Dooku was Sidious' protege and is well aware of the Rule of Two and of how eager and willing Sidious was to dispose of apprentice when needed to create an even stronger apprentice.
And in The Empire Strikes Back:
Vader suggests to Sidious/Emperor Palpatine that "Young Skywalker" would be a powerful ally if he could be turned to the Dark Side.
But this would create problems with the Rule of Two, since that would result in three powerful Sith.
And later, in The Return of the Jedi:
Emperor Palpatine says that Luke will come to Vader and once Luke is on the new Deathstar, the Emperor/Sidious begins to use the same techniques on Luke that he used on Anakin. Even though it's been 20 years, Vader is no dummy, he knows what's going on.
It would seem that Vader's only chance is to influence Luke as soon as he is turned to the dark side and get him to turn against Sidious immediately, but the Emperor's plan is clearly to make Luke so angry he gives into the Dark Side and, in a flurry of passion, attacks Palpatine, then gets into a duel with Vader. (And perhaps if Vader had NOT parried Luke's blow, Luke might have killed Palpatine right then, which would benefit Vader.) This is not a time where Vader could reasonably expect to influence Luke to think enough to redirect his anger toward Palpatine and away from himself (Vader).
I suspect that when Lucas was working on the original trilogy, he hadn't yet come up with the Rule of Two and had not planned for that in his writing, then later, when writing the prequels, had decided it would work for them, but, of course, I don't know this.
Is there any in-universe explanation for why Vader would willingly participate in this plan, knowing that his chance of surviving it is so slim and that he's essentially being used as a tool to create his own replacement?