Anytime you add or take away chickens from the flock you have the potential to change the pecking order or the flock dominance hierarchy. We do it all the time and it is usually not a big deal, but occasionally it causes unrest. You can certainly do what you are talking about.
When you swap out roosters like that you are not likely to change the pecking order, that part normally goes pretty well. But you might change the flock dominance, especially if you add a juvenile rooster to a flock of mature hens. A rooster often has to show a certain level of maturity for a mature hen to accept him as a suitable father to her children. Some hens will squat for practically anything in spurs but a lot of them are more selective. A mature rooster introduced to a flock of hens will immediately mate with a few to establish dominance and just take over. Mature hens may beat up an immature cockerel that tries this or just refuse to mate with him. The dominant hen may especially resist. Since he is probably bigger than the hens he will often resort to force. It can get pretty messy.
Some people do use immature cockerels for this and it usually eventually works out, but things can get pretty exciting in the coop and run while this is going on. The more room they have usually the easier this process is, but a lot depends on the personality of the individual chickens involved.
Any rooster of any breed will try to mate with any hen of any breed. Breed is a manmade thing, chickens have no idea about that. It’s possible you can keep two roosters free ranging with their own flock if you have enough room, but there is no guarantee the flock will split by breed. Even if they did, which they probably will not, there would still be no guarantee which rooster fertilized the egg. The hens and roosters can be pretty sneaky about getting together, even if they are in separate flocks. The only way you can be sure of purebred eggs is to physically make sure they cannot get together.