Nobody would like to risk his money and freedom. That’s why many people start thinking about going offshore with that particular question.
A general answer would be “yes, to go offshore is legal”. However the definition of “going offshore” is not that straightforward.