It's difficult to remain anonymous for so long, so at some point they will catch the attacker. They can force the attacker to hand them private key (if it's a double spending attack), you know threatening them with a lifetime prison, waterboarding, and stuff. Furthermore, they can find major crypto mining facilities and data centres. If they seriously want to take down crypto, they can seize or destroy it (the facilities) with an air strike. Or arrest every single one of developers and waterboard them until they all comply
That is if the attacker exposes his/her identity through a centralized exchange or service. Cashing out crypto to Fiat in-person or through a P2P platform would let the attacker get away with a double-spend attack. It's up to the crypto project's developers to strengthen the Blockchain against further attacks. Some projects are relying on merged-mining for extra security. Others are timestamping their blocks on the main Bitcoin blockchain for complete resiliency against a 51% attack (like Komodo).
It would be "immoral" to attack a blockchain network with the intent of stealing money or preventing others from using the chain. But I wouldn't say it's "illegal" since crypto is decentralized and outside of any government's jurisdiction. In other words, governments cannot enforce the rule of law on a widely-distributed and decentralized system. I'll be interesting to know what will happen in the future once 51% attacks become more common on small blockchain networks. I'm pretty sure centralized exchanges will de-list coins that are deemed "unstable", greatly affecting their market prices. There should be nothing to worry about as long as decentralized alternatives exist. Just my thoughts
I would also doubt that 51% is the part that is illegal. It would be illegal to steal from people, but there are not that many nations who actually see 51% as an illegal thing, not that it is fine but because they just don't have the laws for it yet. So, if you go to cops and say that someone took over a blockchain and made your wallet send the coins to another wallet, they would probably look at you like you are crazy. If hacker is in another nation your job is even harder, all in all it would be quite near impossible to end up with anything that would be legit and proven to be working in a legal court.
All you could do is hope it will be considered "stealing" and not hacking, if it is hacking then you would need to explain how technically it is not hacking into your computer. It is really complicated when it comes to lawyers and all that paperwork to do anything about it.