I think the definitions of sheriff versus that of police chief helps to distinguish whether Will Teasle is truly acting outside the allowable confines of the role.
The easy answer is that sheriffs exercise control exactly the way they want, subject only to the citizenry they serve, because the job is political in addition to law enforcement. His job incorporates law enforcement, but is much more. Based in the tradition of the "shire reeve", who served the dictates of the king, in current times, he serves the dictates of the citizenry who elected him. Keeping the town clear of vagrants seems exactly the type of loosely-defined role a sheriff would be assigned.
While I agree that Teasle may have been unfair and overzealous, I don't believe he did anything illegal. Stallone/Rambo clearly gave off the look and attitude of a drifter (long hair, dishevelled look, American flag decorations, backpack), and Teasle merely made a rapid decision to rush him out of town. For a sheriff who considered his God status unquestionable, Stallone clearly questioned it by returning to town. By twisting the sheriff's arm, he got his own twisted in return.
I don't even believe the actions of the deputies who cleaned Rambo up with the water hose were illegal, either, nor the attempted shave. Every prisoner everywhere gets a shower and a shave. Rambo was not cooperative, possibly even combative, so the exercize of constraint by the beating was something that could be described as defensive, and Rambo would need a witness to the contrary to form a case of brutality.