the motherboard determines what RAM by the slots the motherboard has, the CPU Has the memory controller onboard and the controller determines which RAM can be used.
Example the 6th Genertation intel chips have a memory controller that can run either DDR3L or DDR4. the motherboard will be equipped with either DDR3L slots or DDR4 slots. in this example the motherboard dictates which RAM to use because of the slots the motherboard has the, CPU is flexible. This is rare that a CPU can handle more than one type, and is the only example I know of that is available today.
threadripper/Ryzen DDR4 memory controller
intel 8xxx/7xxx ddr4 memory controller
intel 6xxx DDR3 or DDR4 ready memory controller
AMD fx and APU's DDR3 memory controller...