Every Fediverse server is independently owned and run. This means every server makes its own rules about what you're allowed to do there (for example, pretty much all servers forbid spam).
On Mastodon, you can see your own server's rules by going to your server's website and clicking on the "Learn More" link.
If you see someone breaking the rules, it's important to report them so that the server admins can take action. When you see a rule-breaking post, click on "..." and then "Report", then follow the instructions.
It doesn't matter if the rule-breaker is from your server or another server, if you can see their post you can report it.
The reporting process sends a message to your server's admin, but it also optionally lets you send an anonymous report to the rule-breaker's server admin too. This can be important as the ruler-breaker's server admin has the power to suspend or even close the rule-breaker's account.
@feditips “This can be important as the ruler-breaker's server admin has the power to suspend or even close the rule-breaker's account.” If they’re cooperative.
Indeed, the other server may not be co-operative.
However, your own server admin can block the remote user from communicating with your server, which gives some protection.
Your own server admin can also block the entire other server, for example if the other server isn't moderating anything. A server that consistently misbehaves will end up isolated because so many other servers block it.