No, decentralized exchanges are perfectly legal in most of the world. However, in countries where crypto is banned, some laws may be against their use.