President Carter and Sen. Edward M. Kennedy (D-Mass.) agreed yesterday to debate in Des Moines in early January, two weeks before Iowans meet in precinct caucuses to begin the process of selecting their party's presidential nominee.

Carter was the first to accept an invitation from the Des Moines Register and Tribune for an appearance with Kennedy. A short time later, the Massachusetts senator, who formally will declare his presidential candidacy today, accepted the challenge.

Kennedy, en route to Boston for his announcement, said, "I think it's appropriate to have the debate. I've always debated in the past. I think anybody who seeks the presidency should debate, and I'll look forward to that opportunity."

James Gannon, executive editor of the Register and Tribune, said the debate is being planned for a night during the week of Jan. 7 in 2,500-seat Des Moines Civic Center. While the details have not been settled, he said that questions would be posed to the candidates by a panel of four reporters, two from the Register and Tribune and two national correspondents, followed by questions from the audience.

Gannon predicted that the national television networks will find the first face-toface confrontation between the president and his leading challenger irresistible, turning the Iowa event into a national political spectacle.

The third Democratic presidential contender, California Gov. Edmund G. (jerry) Brown Jr., was not invited to the debate because he "has not mounted any campaign here that is discernible," Gannon said.

The Register and Tribune, Iowa's dominant and most influential daily newspapers, also have invited seven Republican presidential hopefuls to appear in a similar debate format the afternoon of Jan. 5. Gannon said tentative acceptances have been received from several of the Republicans and predicted that there will be a GOP debate involving at least some of the candidates.

Iowa Democrats and Republicans will meet in precinct caucuses Jan. 21 to select delegates to later district conventions and the state conventions that eventually will send Iowa delegates to the national party nominating conventions next summer.

The debate could raise the importance of the Iowa political battlefield far beyond the 50 Democratic convention delegates to be chosen in the state. It is certain to attract intense media coverage and have an impact on later states where Kennedy and the president will meet in primaries.

White House and Carter campaign officials have been considering challenging Kennedy to a debate for some time. They clearly preferred not to issue the challenge themselves, but to find a neutral sponsoring party, such as the Register and Tribune.

The event clearly fits the president's needs, his advisers believe. While Kennedy is considered a better stump speaker, Carter's aides believe the president's strength is in the question-and-answer format, which he has used successfully in his town meetings around the nation.

Carter won a Democratic straw poll in Iowa last Saturday with 70 percent of the vote and is considered to be far ahead of Kennedy in organizational strength there. But public opinion polls earlier in the fall showed Kennedy leading Carter by a substantial margin in Iowa.

In other political developments yesterday, White House press secretary Jody Powell confirmed that Robert S. Strauss, the administration's special ambassador for the Middle East peace negotiations, is resigning to become national chairman of the Carter reelection committee.

Powell also confirmed that Strauss will be replaced in the diplomatic post by Sol M. Linowitz, who helped negotiate the Panama Canal treaties.

Meanwhile, Carter campaign officials announced that S. Lee Kling, a longtime aide to Strauss, would become the campaign committee's national treasurer. John Dalton, who has held the position, will return to a position in the Commerce Department they said.

The Kennedy campaign announced yesterday that former senator Dick Clark, who resigned last week as the Carter administration's special ambassador for refugee programs, would be the national director for political organization of the Kennedy operation.