I was recently told in a Facebook group that I'm not "allowed" to block someone.

I have the right to block someone.
You have the right to block someone.

Facebook (and other providers) have often give us that ability, and it is good that they do.

One can block someone for many different reasons. A block can be for very serious reasons such as limiting harassment or protecting one's mental health. One can block to avoid people who troll, derail conversations, avoid the topic, bother other users, etc. A block can even be for lighter reasons like cutting out noise or avoiding continual self-promoters.

There are two occasions where I would recommend against blocking.
First, blocking is not helpful if it is only to escape earnest and respectful disagreement. We need other viewpoints and variety in our lives.
Second, blocking may not be helpful if it is simply a proxy battle for a relationship one has offline.

Otherwise, I say again: your life and time are worth it: block if you feel you need to! Practice good self-care.

Finally, please don't ever reveal to a blocked person who is blocking them. Understand that they may be blocked because of stalking, harassing, or threatening behavior.