The answer is simple - it depends.

It is usually safe to trade through large exchanges like binance, kraken, etc. but there is no guarantee your data won't leak someday or your wallet won't be compromised.
Brokers have their own set of problems.

In most cases though it works just fine as long as you pay attention and check how legit the business is