Since One Piece follows a group of pirates, the Straw Hat Pirates, the Marines are set as one of the major antagonists of the series. They're constantly chasing the Straw Hats and are always making things hard for them. While the Straw Hats aren't necessarily evil, they aren't the epitome of goodness either. They do what they want to do, regardless of whether or not it's good, and save a lot of people in the process. This may have affected how fans view the concept of justice in the series.
It's easy to hate the Marines in One Piece. They are, after all, the main culprit behind Ace's death, and their noteworthy achievements against the pirates are close to nil. Of course, not all of them are bad. There are fan-favorite characters like Garp, Sengoku and Koby among their ranks, but that does little to curb the organization's terrible image. Nonetheless, this doesn't change the fact that the denizens of this world of pirates hold them as the embodiment of justice itself.
Justice plays a major role in the Marines. It's even written on the back of the Marines' coats. In summary, Marines justice boils down to giving criminals their due punishment, but One Piece has repeatedly shown that such a vague concept is left to interpretation. Major members of the Marines have their own take of what justice is, and Smoker even encouraged Tashigi to create her version of it. This gives leeway for the likes of Fujitora, who opposes following legal but inhumane practices, and Garp, who does whatever he feels like doing. On the other side of the coin, it also allows characters like Rob Lucci to use it as a reason to commit heinous acts and remain at large.
A huge chunk of the Marines believes in absolute justice, meaning that anything against the law is inexcusable and perpetrators must be punished even at the cost of civilian lives. Fleet Admiral Sakazuki, or just Akainu, is a notorious believer of this. He doesn't let a single criminal go, even if they're a child, which rouses doubts if the Marines' justice is actually true justice.
Similar to how the Marines have multiple interpretations of justice, other factions also have theirs. The Straw Hat Pirates in particular base their actions on Luffy's moral compass. Regardless of what's lawful and what's not, Luffy beats up anybody he deems to be evil. That includes Celestial Dragons, Marines and fellow pirates. He disregards any rules or definition of evil set by anybody else and follows his own ethical code. Doflamingo has a darker but realistic take on it; according to him, justice prevails simply because justice is whoever remains standing.
With multiple takes on the matter, it's reasonable for fans to be confused as to what true justice can be. The series follows the Straw Hat Pirates, so it's also highly likely that the fans' belief of justice -- when it comes to One Piece -- are skewed toward their side. However, to understand what justice truly is, it should be viewed as a concept and not as a character or group of characters. Justice is fundamentally about doing what's right. While the Straw Hat Pirates may seem to fit this description, such is not the case. After all, they've stolen numerous treasures, sunk countless ships and killed countless unnamed characters along the process -- and they're still up and about chasing their dreams.
The concept of justice can be difficult to grasp since it can be interpreted in various ways. Even though some interpretations hold a lot of sense, these don't necessarily amount to being the gold standard. At the end of the day, justice is about acting upon what is just.