Yes it is legal to buy gold, at least until the law (and I’m considering the UK here) is changedto formally acknowledge digital goods, particularly in game as property which opens up a whole can of worms around gold taken from hacked accounts, who owns it, proving that the gold bought was the same as the gold stolen etc etc. Until then there isn’t a law being broken.
However, will it loose you your account, entirely possibly because what has been broken is the terms of the contract between you and Blizzard. The ToS is clear on this, as is Blizzards interpretation of them, buying in-game items for real money is a no-no (unless it’s Blizzard sanctioned). It’s very simple, you buy gold and your account could be heading for a perma-ban.
It’s also stupid, the gold sellers are hacking accounts en-mass to provide the gold reserves they need to sell onto players who either can’t work out how to get in-game gold, too stupid to work it out or just can’t be bothered. Hacked accounts are a bad thing, let’s not beat about the bush here, recently one of our raiding guild’s tanks got his account hacked, which probably means his computer was compromised (In the EU this comes under the various computer misuse acts which incorporate EU directives on this matter), so there is illegal activity, he had to spend time chasing down Blizz to get the situation looked at (wasted time and effort), check his machine (wasted time and effort) and cost Blizz time in going through logs of activity, resetting account details and rolling his alts back to where they were. That’s a direct cost on Blizzard. On the plus side in his case everything was back to normal in 48 hours (damm good effort there).
There is very little detail on what the companies selling gold are doing with their cash, you can bet that getting it back from them if your account is terminated is going to be “difficult”, and given that we are dealing with people who are willing to compromise your machine are you happy giving them your bank details, remember, they’ve probably had a keylogger installed.
I would suggest that it is safe to assume dishonest intent when dealing with gold sellers, caveat emptor applies here with a large side order of “use your brain and don’t deal with gold sellers“.