* The Border is a messy and often nasty movie about a border guard in Texas, defending American turf against illegal immigrants from Mexico. Ultimately, the story sympathizes with the good guy -- played by Jack Nicholson -- and his deep-down friendliness toward the poor and oppressed, as symbolized by a Mexican woman he tries to help. But every opportunity for redneck violence is seized and exploited, and the film's attitude toward its main female character (the hero's wife, played by Valerie Perrine) is unpleasantly snide. The director was Tony Richardson, who displayed his social consciousness to much better effect in such memorable British pictures as ''The Loneliness of the Long Distance Runner'' and ''A Taste of Honey,'' years ago. ''The Border'' is a line he should never have crossed.