In most states that is not possible.
There are eight states where ballots won’t even have a space for write-ins. In 32 others, write-in candidates have to file with the state prior to the election to be counted as official candidates.
That means that even if a write-in candidate wins the popular vote — an extremely unlikely scenario — their votes won’t be counted if the candidate hasn’t pre-registered. States often throw these write-in votes for unregistered candidates into an “All others” category and don’t tally them up individually...
But that won’t stop tens of thousands of voters from supporting write-ins in 2016, whether on principle, or as an act of protest of the two major-party candidates.
More at the Washington Post.