That’s not strictly true. A board and CPU may not support all speeds, or mixed ranks. ECC and registered RAM would also fit but not necessarily work. There’s also low-power RAM that may not be compatible. Just because it fits, it doesn’t mean it’ll work.
In OP’s case, it’s likely to be supported because it’s probably not ECC, registered, and consumer boards usually support the most common speeds. I don’t know how compatibility on low-power RAM goes.