In that case, yes. Unless the person is a voter in the act of voting.
(Other jurisdictions may have other rules, of course)
If it was a police officer wearing that or a poll worker, that's not acceptable. If it was a voter in act of voting it is fine.
I doubt the regulations around polling places consider that relevant. I'd guess one party wears cowboy hats more often than the other, but that doesn't make them a political statement.
It's called "letter of the law" vs "spirit of the law",
Purposely violating the principle of the law by abusing loopholes, and proceeding to claim that technically violating the spirit of the law is not illegal because you came up with a loophole that you believe is not incompatible with the letter of the law just goes to show the level of dedication that you have to break the law without being punished for your transgression.
If I wear a shirt with MEDICARE FOR ALL, GREEN NEW DEAL (or SUPPORT ACA and REJOIN PARIS ACCORDS) on it, that's clear partisan support. That's illegal. Thin blue line flags and "support our troops" are out of place and it's two-faced to pretend it isn't just a signal of partisan support. These are some of the major party issues.
Bad taste has nothing to do with it. If someone wears a SUPPORT THE CURRENT PRESIDENT shirt, that's support of Trump, not endorsement of the concept of government or something nonpartisan.
If it is what he says, then it was simply a copy of text that all soldiers swear to when they enlist. The U.S. Army is not a political organization and contains people from all backgrounds.
What really seems to have happened here is that the author was able to reasonably infer this police officers political affiliation from his clothing and that is not what is prohibited in these laws.
As long as you'll admit that BLM falls under this same logic, and should similarly be banned, then you're being consistent.
If not, you're being hypocritical.