What happens when you replicate a legendary creature with Rite of Replication?
The token will enter the battlefield when the spell resolves and, the next time any player would receive priority, you'd have to choose one of the legendary permanents to stay on the battlefield. The copies would then be put into your graveyard.
This is governed by rule 704.5j:
If a player controls two or more legendary permanents with the same name, that player chooses one of them, and the rest are put into their owners’ graveyards.
This will happen the next time you would receive priority because it's a state-based action:
704.3. Whenever a player would get priority (see rule 117, “Timing and Priority”), the game checks for any of the listed conditions for state-based actions, then performs all applicable state-based actions simultaneously as a single event.[...]
As a side note, like @Gendolkari mentioned, this interaction is no different than simply casting another copy of a legendary permanent you already have on the battlefield. In this case, the exact same rulings will apply.
The other answer is correct, the one big extra thing to be aware of though is that enter the battlefield abilities would trigger and would see each other entering.
For example kick a Rite of Replication:
Create a token that's a copy of target creature. If this spell was kicked, create five of those tokens instead.
On a Reaper King which is a legendary scarecrow that among other things says:
Whenever another Scarecrow enters the battlefield under your control, destroy target permanent.
You would simultaneously create 5 token copies of reaper king.
You would then choose 1 out of the 6 to keep due to the legend rule
However this doesn't do nothing as the original would see all 5 enter. Additionally each of the 5 would see the other 4 enter as they enter simultaneously.
So you would sacrifice 5 Repaer Kings and get 5*4 + 5 = 25 instances of the Reaper King trigger, each of which can be used to destroy a target permanent and are placed onto the stack as you choose.