Mining cryptocurrency has its similarities and differences with mining for gold. It might be the new age equivalent of being a gold miner, but a crypto mine looks much different than a gold mine.
Mining cryptocurrency is not banned or illegal in most countries, including the USA. However, there are countries where it has been made illegal, most notably in China.