I am not technical so maybe this questions sound stupid. But this topic really interests me.

I read that Rarbg was like thepiratebay but safer. I guess that's due to moderation to check which torrents are safe, right?

This people had a website that offered a nice UI to find torrents. Did they had ads to make money? So they offered their services to maintain healthy piracy in exchange of money and also to pay servers. (I am not criticize or judging I just want to understand how it worked)

Would It be possible to share the same website using a torrent file? Like shipping and actualizing the website and sending to users trough torrent so they can search it locally? Or send a sql database and then create a UI for users to search trough it? Or would be complications because torrenting exposes our ip?

Sites can't be offered as torrents, because generally torrents are immutable once they have been created. You can't say "oops, that version of the file is wrong" and start offering the new version within that same torrent swarm.

However, there was an update to the protocol, BEP44, that did allow you to update the already-in-progress torrent.

Furthermore, there is a protocol called WebTorrent that swaps out some of the other base protocols for WebRTC, allowing a web browser to participate in the torrents. You could just include a link to the library via CDN. The trouble of course is that bittorrent now relies on DHT more and more (you wouldn't want to have to run a tracker, if you did it'd just be a target of legal attacks)... and WebTorrent can't do DHT (of any variety) well. There was a proposal to allow browsers to be able to do native network sockets, but I think that got turned down by Mozilla (maybe they were more concerned with doing VPN ads or something).

But if you had that, then yes, it might be possible to have something like a "swarmsite" that didn't need to be hosted.

See ZeroNet, which uses bittorrent to sync websites, including support for dynamic content and accounts. (Accounts are somewhat centralized last i checked) https://github.com/HelloZeroNet/ZeroNet

The main/original author disappeared but there are somewhat maintained community forks.