Buying soil off the internet or buying soil from regular marketplaces is completely legal and can be done without any legal issues. However, when you start growing weed - that should become a matter of legality because growing weed might not be allowed in your jurisdiction. You need to check your local laws to know if you can grow weed - and if so, how much weed are you allowed to grow at home.