How is P2P safe?

One of my colleagues raised this question to me when I was boasting about using torrents. He asked me if the network is P2P, then wouldn’t that mean there is a potential risk of my data leaking to any other peer in the network to whom I might be connected to. There could be the possibility of getting hacked.

Is this true, if yes then to what extent? P2P is really good for decentralizing things, but is it really safer?

Much like any network it is as secure as you configure it to be. If you lock down your peer sufficiently there is no more risk of losing data.