If i buy minecraft for pc, i ll be able to play on servers?

I can't seem to be able to join many servers if i just torrent it

Yes, you should be able to connect to servers if you buy the full version of minecraft

Yes, you will be able to play on many servers.

There's an option in the server configuration that can allow pirated versions of the game to join. However most servers don't enable this because they don't want to promote piracy plus people can just use it to bypass server bans

By default, all servers will check with the Minecraft account servers to verified that you're a "Premium Account" (meaning that you paid for the game) before their server will allow them to join. This is mostly an anti-piracy & anti-cheating / anti-trolling measures as it helps to enforce user bans.

With that said, server admins / owners can manually disable this check to allow anybody on. While it's helpful when the Account Servers go down for some reason, it makes it impossible for user bans to be properly enforced as users can choose whatever name they like (making it easy to bypass user bans).

Public servers that have this check disabled are usually more pirate-friendly & generally don't enforce any rules… So an established player could just troll & harass a newbie for as long as they like without any administrative retribution. HOWEVER, newbies are free to loot any chest they come across on the server (so an established player who doesn't properly protect their chests can get items stolen).

As a result, you will want to buy the game if you want to play with others online without being branded as a pirate.