Every cpu has a matching socket. But thats only a reference to the generation of the motherboard mounting holes spacing. Intel uses a land grid array (LGA) type socket that uses 1150-1156 pins. So you get LGA1151 or LGA1155 etc. Intel however, has not changed its cooler mounting holes spacing on any of its LGA115x motherboards, so basically unless you have an extremely old LGA771/775 or LGA1366 or any of the HEDT cpu like LGA2011-3, then any cooler with an intel mount will work.
Amd is a little different. Their mounting spaces hadn't changed in years either, FM, FM2, AM2, AM3+, all the same. They did change for AM4, so that's the oddball.
Unless specified specifically (like cryorig m9i or M9a) for the oddballs, ancients, or HEDT sockets, you'll get an am3+ amd mount, AM4 amd mount and lga115x mount with any new cooler.
True, but that's the mounting itself, if you take that mount off, the spacing between the holes for replacement is different. So the mount on your old faithful hyper212 evo you love that's currently on your fx 8350, won't fit the new AM4 mobo, although if you bought a new cooler, it'd come with the correctly spaced mount.