In his 24 years in Congress, Democratic Rep. Samuel S. Stratton, the third-ranking member of the House Armed Services Committee, has made a national reputation as a stern advocate of the military.

Since he was first elected in 1958, Stratton has turned back challenges from anti-Vietnam war activists, liberal Democrats and other incumbent congressmen in winning reelection 11 times.

This year, the nuclear freeze movement has taken him on. PeacePAC, the political arm of the Council for a Livable World, named Stratton as one of the 12 "Doomsday Dozen" congressmen it has targeted for defeat.

In addition, Stratton was the only candidate opposed by the New York State Nuclear Freeze Ballot Campaign.

Stratton is one of the last of the Cold War liberals, pro-labor and an advocate of wage and price controls, but a staunch anti-communist.

His deeply entrenched popularity in his district and its dependence on defense-related jobs apparently makes him as impervious to this challenge as those in the past.

In last month's Democratic primary, he defeated former representative John Dow, 77, who was one of the first congressmen to oppose the Vietnam war, by nearly 3 to 1.

In November, Stratton again faces Dow, who is the Liberal Party candidate, in the general election. His Republican opponent is Frank Wicks, a nuclear freeze advocate who was Stratton's opponent two years ago.

Wicks also is running on a second ballot line as the candidate of the Nuclear Freeze Party.

One measure of the nuclear freeze advocates' desperate position here is Stratton's victory margin over Wicks in 1980: 78 percent to 18 percent.

According to Wicks, the ballot line makes this year's race a real referendum on the nuclear freeze.

"It does give a candidate a chance to consolidate the nuclear freeze votes," said Wicks, 43, supervisor of the nuclear plants operations curricula at Rensselaer Polytechnic Institute in nearby Troy.

"The longer I can campaign on this great issue of a nuclear arms reduction, the better," said Dow. "This will give some voters who are not enrolled in any party a chance to vote their preference on this issue."

Stratton, a supporter of President Reagan's arms negotiations proposals, has consistently opposed the nuclear weapons freeze and helped defeat the freeze resolution in Congress.

"The difficulty with the nuclear freeze is that, contrary to what the advocates say, we are behind the Soviet Union in a number of important areas," Stratton said. "Freezing at the current levels would put us in a position of inferiority. That is a dangerous and destabilizing position to be in."

The battleground is a heavily Democratic district drawn by the state legislature to favor Stratton, who has built his political strength over the years with a indefatigable attention to constituent services.

It includes one of the last old-line political machines, the Albany Demcoratic organization headed by Erastus Corning II, himself the nation's longest tenured big-city mayor.

The district's eastern boundary is the city of Troy, known as the Collar City because of the shirt manufacturers who used to be located there. At the west end is Stratton's home city of Amsterdam, known as the Rug City because it used to house carpet mills.

The manufacturing plants have moved south. Left behind are thousands of defense-related jobs that Stratton helped bring to the area.

To Stratton, the main issue in the campaign is seniority.

His experience, he said, means that he can feed the district a steady diet of federal grants and contracts.

"These things don't happen automatically because you're a congressman," Stratton said. "You have to go out and get them. You have to have clout.

"I happen to be the senior Democrat from New York State. The chairman of the delegation. That means we have access to stuff that other congressmen don't have. We ought not to throw it away."