Were there any characters named "Earp" or "Wyatt", or were there any characters from a military background who were town sheriffs?
To answer this quite bluntly, No. There are no references to OK Corral or Wyatt Earp nor any town sheriffs that had their background even briefly revealed. But there are some things that might be indirectly related or referenced to these. I'll explain.
While there are no solid references in the anime to these, there are some what after images or familiar presences to them.
Yasuhiro Nightow, the creator of Trigun series and manga, was in-fact inspired by western films genre. He created the character Vash in a similar way to those he idolized in these films. More specifically a "Gunfighter". Now when someone says Gunfighter to you, there are a few key names that pop into your mind like; Billy the Kid, Pat Garrett and of course Wyatt Earp. Whether these people had any direct influence on this anime is something that is unknown. Only way to know would to ask YN himself.
Also during this time there were other anime and manga taking the same approach. Such as Kino's Journey or Cowboy Bebop.
So basically the answer is "No" but watching Trigun may send vibes from some of the characters or locations or pretty much anything that may relates to the old west.
(These answers were based off personal knowledge and having watched and loved the Trigun series, so much that I just watched it again like 3 days ago.)