In theory, absolutely! But this doesn't mean as much as you might think.
In most states (35, I believe) for a vote to count, it must be for a registered candidate. There's a process to be listed on the ballot (filing on time, collecting signatures, etc.) and a somewhat less arduous process to register as a possible write-in candidate. In those states, if you write in a name of someone that isn't running as a joke or a protest, it won't count. It will only count if you write the name exactly as it appears in the registration (which can be a cote-counting headache).
Of the remaining states, some don't allow write-ins at all, and some allow any write-ins. I'm not sure what the process is for counting those votes in the few states that allow all write-ins (how do they know which "Joe Brown" you mean?). It'd be interesting to research.
In practice, of course, I don't know that it matters much. It would be highly unusual for a candidate to make a serious run without getting on the ballot.