Yes, they can. After all, it's supposed to be presumed that judges always decide cases based on the law & precedent, & not on personal biases (though they obviously don't participate in the political process itself by publicizing their choice of candidate, etc.). A justice doesn't lose their basic right to vote in any local, state, or national election simply b/c they've been appointed to the Court.
Ginsburg, Breyer, Sotomayor, & Kagan voted for Clinton (as did all the retired justices at the time of the election: Stevens, O'Connor (b/c woman + moderate centrist + likely anti-Trump), & Souter
Thomas voted for Trump.
I legitimately can't guess as to whom Roberts, Alito, & Gorsuch voted for, esp. the former 2. I'm tilting toward believing that Gorsuch voted for Trump only b/c of the self-incentive attached to Trump in that his own name was already published to Trump's Supreme Court list by Election Day, but I don't know. The way I see it, many sane members of the Republican political establishment (in the privacy of the voting booth) likely didn't bring themselves to vote for Trump (even if they publicized for political purposes their assertion that they would). But Roberts, Alito, & Gorsuch, while being philosophically the same as the Republican establishment & very much a part of the judicial conservative establishment, aren't even a part of the political process, & as such never had to publicize their "intention" to vote for Trump, leading me to believe it's even less likely that these "sane conservatives" did vote for Trump.
Kavanaugh didn't vote.
Kennedy might have voted for Trump, & the familial closeness + the fact that he retired under Trump makes that more likely.
Scalia, if he had the opportunity to vote in the GOP presidential primary by absentee ballot prior to his passing, voted for Trump.
I have a feeling Scalia voted Cruz if he voted in the primary.