Depends on where it's being used, for example in Hacking, BlackHat is considered illegal, because of why, how, when it's being put to use. while whitehat is considered legal, if done with target's concent, or as part of a job, to test security and so on.
in other terms, blackhat symbolise now for the " other" way around, taking shortcuts, to achieve certain goals in less time that it usually takes when using the normal methods.
there is still a debate for how legal is that, but as long as you are doing things for your own, on your own websites, your own articles, whatever.. and not harming others or gaining unwanted access, it's legal.