Both the i5-6500 and the i5-6700 are of the socket FCLGA1151 form factor, so theoretically, the upgrade should work.
I say 'theoretically', because while on a standard x64 motherboard, running Windows or Linux, it most definitely would be fine.
However, Apple make it their business to wilfully prevent as many consumer upgrades and repairs as is humanly possible. For example, they have started soldering SSD drives onto motherboards, and in some cases, RAM. It would not surprise me at all if this had been prevented, but if you've read that it is, you may be ok with it.
To clarify, the problem (if indeed there is one) isn't generically a hardware compatibility one - it's whether Apple have, on purpose, prevented CPU replacement. Focus your investigations in this area.
Sorry that's not comprehensive, but I hope it helps you look for the relevant info.