Usually, the chances are IN your favor if the memory has speed and timings consistent with, and within, the JEDEC standards. For modern Intel that's generally 2666mhz or lower for 8th and 9th gen, 2400mhz or lower for 7th gen and 2133mhz for 6th gen. For Ryzen, that's generally 2133mhz. Anything outside the JEDEC standards and you begin rolling the dice. It might work, or it might not.
Variables that might affect the probability of it working including HOW MANY modules are involved, because with four sticks the chances are much greater that one of them OR one of two sets, might not play nice with the other, how far apart the profile timings are, what the speed differences are (If any) and also what the motherboard and CPU in use are because those can absolutely be a factor as well.