Why would you do that other than to troll election workers?
The answer is it depends on state law. Typically, write-in votes are only valid if the candidate is recognized as eligible for write-ins. Especially for president because if a candidate doesn't have electors, voting for them is pointless. I know in NY write-in votes for candidates already on the ballot don't count (because I was researching NY write-in law yesterday for other reasons
). I don't know what the law is in Maryland. You could call the board of elections and ask if you really want to.