Is mining in Scotland legal? I thought some countries are not endorsing this kind of business.
Scotland is part of the United Kingdom/UK. They don't have any restrictions with this kind of thing and never will.
Other countries though may try and stop importing miners - such as Vietnam's recent announcement:
https://blockspoint.com/vietnam-to-stop-importing-mining-equipment