There is no guarantee that the individual memory modules will be compatible with each, even if the memory modules are the same brand and part number.
When wanting dual channel memory operation, it is usually recommended getting a dual channel kit where the two modules have been tested and are guaranteed to be compatible with each other.
Note that dual channel memory operation does not necessarily require that the module capacities be the same in each of the two memory channels.
Assuming two individual memory modules are compatible with each other (due to module characteristics), and with an 8 GB module in one channel, and a 16 GB module in the other channel. The system should run the memory in a combination of single and dual channel modes due to a feature called "Flex Mode". The 8 GB module should run in dual channel mode with 8 GB of the 16 GB module. The remaining 8 GB from the 16 GB module should run in single channel mode.
However, to maximize memory bandwidth and system performance though, ALL memory capacity within each channel should operate in dual channel mode. So could use 2 x 8 GB modules, or 2 x 16 GB modules (from a dual channel kit). Running different capacity memories within each channel and with resulting dual and single channel memory modes operating tends to cause a slight performance drop.