In most jurisdictions, any party with a real and legitimate interest in the outcome can file an opposition. In practice, the vast majority of oppositions are filed by owners of earlier registered or pending trademarks that are confusingly similar to the applied-for mark.
Besides owners of previously registered trademarks, oppositions are also filed by consumer protection organizations, governmental bodies, geographical indication authorities, and in some jurisdictions, members of the public where the mark is considered offensive or contrary to public interest. The IP office will assess whether the opposing party has a sufficient basis for their challenge before proceeding.