Mainly for the front soundstage. You want the speakers to be as nearly matches as possible across the front to avoid changes in tonality and voicing as a character moves across the screen. This is less important for the rears, because the rears are generally for immersion and your ears sensitivity behind you is different than the front, especially with regard to frequency. For a subwoofer you can also mix and match, because it is covering a different band of frequencies, but it should still be able to integrate with the mains well.
So, generally you can mix anything except the front three speakers.