He's the devil version of Jim Duncan. Here's proof:
-1. He has no name and towards the end when the midget sheriff/mayor says he doesn't know his name, the stranger replies, "Yes you do." He rides off and vanishes. Before vanishing, the camera pans to the gravestone that says "Here Lies Jim Duncan" which was just carved by Mordecai the midget before the stranger took off. One of the characters even said a few scenes earlier, "They say the dead don't rest without a marker of some kind".
.2. Why did he dream of a sheriff getting whipped to death if he wasn't there when the memory happened? Because it must be him getting whipped to death. In fact, the actor who played the sheriff in the flashbacks was Eastwood's stunt double Buddy Van Horn.
-3. He paints the town red. This also symbolizes blood because of blood on the hands of the townspeople for standing around and doing nothing about the murder of their sheriff and that hell is a fiery red image, or anger which is red as an expression. Plus the devil is red anyhow.
-4. The Belding's character says in a town meeting inside the church, "It couldn't be worse if the devil himself rode right into Lago." The next shot is of the stranger.
-5. Why would the unmarked gravestone remain unmarked for all this time until after the stranger leaves when no one expected him to arrive?
-6. Towards the end before Stacey Bridges is shot and killed, the stranger whispers, "Help Me!" Help Me!" How would he know the sheriff said those words the night he was killed?
-7. When he whipped one of the cousins to death, how did he know the sheriff was also whipped? Also, the town was in flames in the background of the Stranger while the whipping happened. More of a sign that it's Hell.
-8. The first time the stranger reacts to anything in Lago is the sound of a horse whip. He turns around looking scared. Suppose the whip reminded him how he died?
-9. Another sign is when a woman says "You're the kind of man that makes people afraid and that's dangerous." Eastwood replies, "Well, it's what people don't know about themselves inside that make them afraid." The final sentence proves he's showing his inner demons by returning with a beard, hat and personality that he never had before. Sort of like Jekyll and Hyde.
-10. Besides, when he's asked by the girl "Have you ever heard of a man named Jim Duncan?" He says, "I've heard a lot of things. Why?" No one mentioned Jim Duncan to him and when a dead sheriff was brought to his attention earlier, the name wasn't. She didn't mention that Jim was sheriff until after his response.