putting ram not supported on a motherboard will not work at the listed speed of the ram.
you are correct, generally speaking the motherboard is the one that will dictate what max speed ram can run (aside cpu restrictions in some cases).
now if the motherboard permits for example 1866 max speed and you try to put 2400 ram in it, (assuming your matching DDR3 or DDR4 requirements) the ram will more than likely only run at 1866 not at 2400, and you will not be able to overclock it to 2400 either.
in some cases mostly holds true with Hxxx series boards, if the board lists 1600 max ram speed I have seen people putting 1866 ram and it not working on the motherboard, but in most cases the motherboard can run the ram at the speed it can handle...