Electors constitutionally remain free to cast their ballots for any person they wish and occasionally they have done so. In 1968, for example, a Republican elector in North Carolina chose to cast his vote not for Richard M. Nixon, who had won a plurality in the state, but for George Wallace, the independent candidate who had won the second greatest number of votes. Members of both the House of Representatives and of the Senate objected to counting that vote for Mr. Wallace and insisted that it should be counted for Mr. Nixon, but both bodies decided to count the vote as cast.
https://constitution.congress.gov/browse/essay/artII-S1-C2-1-2-3/ALDE_00001123/