It’s definitely going to depend on what type of key you have. The ones at my local supermarket are very simple and practically can only copy house keys. I’ve definitely copied rental apartment keys with it though that have a “do not copy” text engraved.
Postbox keys and automotive keys, I don’t know of any machine that copies them in my area. Not because they detect and refuse, but because it needs to be the correct key size.
If it actually has the right size key available, I’ve yet to come across a machine that would actually inspect the key to see if it was labeled to refuse copying.