Your exchange can get registered and be given license which makes the exchange to be legal in your country, but that does jot mean it can not get into legal trouble if the exchange is linked to crime or misappropriation of customers money and others. Example is FTX that later got collapsed.