What are transactions from and to exchanges wallets? I am analyzing bitcoin blockchain data, I have the addresses corresponding to a set of exchanges (extracted from walletexplorer) and I'm looking at the transactions made from and to those addresses.

At the beginning I thought these transactions to exchanges' addresses corresponded to people selling their bitcoins (most probably for USD) when the transaction was made FROM an outside address TO an exchange addresses, or to people buying bitcoins when it was on the opposite direction.

Am I right on this statement? Or am I missing something?
Its not really possible to tell for sure, but if somehow you found a list of some deposit addresses for an exchange, then yes its likely that transactions sent TO the exchange were sent so that those users could exchange the bitcoin for another currency. And likewise, transactions FROM an exchange might be withdrawals from users' accounts. But each exchange might manage the funds sent differently, some might be transfers to cold wallets, or payments to service providers / employees for example, there could be many things you haven't considered.