The MSI B150M (having a B150 chipset that was released coinciding the 6th-gen Intel Skylake CPUs) *might* need a BIOS update for a 7th-gen Intel Kaby Lake CPU (such as that i5-7400) to work, most especially IF the motherboard you will get was manufactured PRIOR to the release of the Kaby Lake CPUs.
There is also a chance that the MSI B150M motherboard you might receive was manufactured AFTER the release of Kaby Lake, wherein, there is a *possibility* that the motherboard has already an updated BIOS out-of-the-box to support the i5-7400. Else, the i5-7400 will fit, but won't boot.
Only way to boot it up to update the BIOS is to plug in a Skylake CPU.
So, to eliminate the chances/risks of these hassles and incompatibilities, I would...