Yes, it's legal. It is illegal to make illicit use of it, to launder money or hide assets that are not yours or to evade taxes.