That can damage both the device you’re charging and your MacBook. USB-C devices can draw significantly more power, so if you use a USB-A port to charge a USB-C device, then a non-compliant cable can draw more power than the port is designed to handle. Those were designed with a maximum current draw as part of the spec. That latter problem is specific to older MacBooks, with a USB-A port. And yet others can draw too much power, which can not only damage any device you’re charging it with, but could even damage the USB port in your MacBook. Some non-compliant cables simply won’t offer the full data speeds they promise. More worryingly, many cables being sold as USB-C don’t fully conform to that standard – and that can be seriously bad news …
In practice, there are different versions of the standard.
In theory, all USB-C cables should be the same: that’s the whole point of having a standard.