Yes, DEXs are legal, though they do operate in something of a gray area (like most of the crypto space) in that they’re unregulated by a central government authority. Some exchanges may be illegal in certain jurisdictions, too. That may change in the future, though, as regulators outline plans and potential rules for the crypto space.