There are very few countries where it's explicitly illegal.
In most places it doesn't have much of a legal status. If it's a deal between two people it doesn't matter anyway. If one person wants to pay in it and the other is willing to accept it then it's job jobbed.