While they would physically work together, there are some choices that could be improved significantly.
- It doesn't make sense to be on an older platform, especially because you're not getting any price benefit. An i5-8600k, that can be purchased for €100 less isn't actually outperformed by any significant margin by an i7-7700k. Intel added cores in that generation, so the 8600k is a 6 core/6 thread while the 7700k is a 4 core/8 thread.
A 7700k would make sense over a Coffee Lake if you already *had* a Z270 motherboard, but considering you're purchasing a B350, it appears that you do not.
- You selected a motherboard that can't overclock, which means paying extra for the unlocked multiplier of a 7700k is more or less a waste of...