President Carter accused Ronald Reagan today of advocating a nuclear arms policy that would pose a "serious threat" to the "safety and the security and the peace of our nation and of the world."

Coming closer than ever to charging that a Reagan victory in November would increase the risk of world war, Carter accused his Republican opponent of intending to set off "a massive nuclear arms race with the Soviet Union" that would break a tradition of arms control negotiations dating back to President Dwight D. Eisenhower.

"Therein lies one of the sharpest differences between myself and Gov. Reagan" one of the key issues in the 1980 presidential election, the president said in response to a question at a "town meeting" at Truman High School here this morning.

Carter cited the efforts of his predecessors to negotiate arms control agreements with the Soviets and said, "Ronald Reagan is the first one to depart from that commitment."

"I consider this one of the most serious threats to the safety and the security and the peace of our nation and of the world that is being dramatized in this 1980 election," he said.

The president added that he favors a steady but gradual increase in defense spending "not only to keep our nation secure, but to keep us out of war, not in a war."

Carter's comments on nuclear arms policy were his sharpest attack yet on Reagan as he continued his strategy of trying to portray the GOP nominee as a political ideologue who would make a risky chief executive.

The president arrived here this morning in the hometown of President Harry S. Truman with two purposes in mind.

One was to wrap himself in the mantle of the once embattled Truman, whose 1948 come-from-behind victory over Republican Thomas Dewey is one of the legends of American politics.

Carter's other purpose, which is a theme he is likely to use throughout the campaign, was to paint Reagan as the embodiment of fringe politics outside the historic traditions of the Republican Party.

In response to a question of "why in the hell do you think Reagan would want to be president," Carter said:

"Reagan is diffeent from me in almost every basic element of commitment and experience and promise to the American people. The Republican Party is now sharply different from what the Democratic Party is and . . . the Republican Party is sharply different under Reagan from what it is under Gerald Ford and presidents all the way back to Eisenhower.

"I believe in peace, I believe in arms control, I believe in controlling nuclear weapons, I believe in the rights of working people of this country, I believe in looking forward and not backward. I don't believe the nation ought to be divided one region from another. In all these respects, Gov. Reagan is different from me . . ."

A friendly, enthusiastic crowd greeted the president in the gymnasium of Truman High School for the one-hour town meeting, one of the most effective political devices Carter has used throughout his presidency. In response to other questions, the president:

Said neither he nor the Senate will consider action on the pending strategic arms limitation treaty with the Soviet Union until there is "positive movement" toward a Soviet troop withdrawal from Afghanistan.

Pledged that there will be no change in U.S. policy in the Middle East "in the foreseeable future" and appeared to suggest the possibility of a new summit meeting on the Middle East peace negotiations fairly soon. However, White House officials later said there are no plans now for such a summit.

Endorsed voluntary prayer in the public schools, but said he is opposed to "the government telling people they have to pray in a certain way at a certain time."

Throughout the town meeting Carter stressed the theme of peace, saying that he was grateful the country has been at peace during his term and suggested by implication that a Reagan presidency might pose a threat to that peace.

Carter said he is "looking forward to a chance to debate Gov. Reagan," but he suggested no change in his opposition to the inclusion of independent presidential candidate John B. Anderson in an initial debate. A dispute over whether Anderson will be included in the first debate as Reagan wants has deadlocked the negotiations over arranging a Carter-Reagan confrontation.

The president's stop here, on the second day of his general election campaign, was meant to identify his candidacy with the Truman tradition of 1948. Over the years, the Truman victory has become a symbol of political vindication, citied by embattled Republicans as well as Democrats, a development that undoubtedly would have offended the deeply partisan Truman. a

On his way to the high school, Carter stopped at the Truman residence for a 10-minute visit with the late president's 95-year-old widow, Bess, Following the town meeting, he also toured the nearby Truman Library.

At this early stage in the campaign, however, Carter, who has drawn nearly even with Reagan in most national polls, looks like far less an underdog than he did over the summer or than Truman was at this point in his famous come-from-behind campaign.

Carter returned to Washington immediately after his three-hour visit to Independence, his only campaign appearance today. He is to resume campaigning Wednesday in Philadelphia.