Not directly, but I can see 2 indirect ways:
- If the software phones home, the company might catch you using a key they know is cracked, and try to track you down and punish you (whether themselves or through legal intermediaries).
- If you are using a cracked key, you are probably using cracked software, so you are exposed to risk from that.
A key, by itself, cannot compromise your computer in any way, unless the software is explicitly programmed to act maliciously in response to a cracked key (it's still a question how it will tell which keys are cracked...). The key is just a password for you to prove that you have the right to run the software (ie. that you obtained a license to that program by buying it).
But this is a bit of a moot point because no one just uses a cracked key for no reason - they use it because their software is also cracked (so #2) and even if you have legally obtained software, just putting in a cracked key is not necessarily safe (because of #1).
In the olden days it used to be that programs would simply run a mathematical operation on the key and decide whether they accept it or not (and even earlier, there would literally be a few questions with a secret answer). The exact algorithm would be secret and hard to guess, so you would basically only be able to run the software if the developer generates a correct key for you. Crackers would reverse engineer the algorithm and generate their own keys - it's hard to see how a software could distinguish between keys generated by copyright infringers and keys generated by the developer (in fact, its ability to distinguish this was the algorithm in the first place, and that has already been defeated at this point). Granted, often the crackers then distribute the key generator with a virus in it, so there's that.
After internet became ubiquitous, companies have moved on to just maintaining a list of keys they received payment for, and making software phone home to check. Now "cracked keys" come from someone who works at a company with a volume licensing key, who then leak that key. If the developer catches on, they may revoke that key to render it useless. Since the key was intended to be legitimate (and initially was), it's hard to see how it would harm your computer. But, like I said, if the software phones home, you'd be making yourself conspicuous.