President Reagan welcomed Brig. Gen. James L. Dozier home from 42 days of captivity yesterday at the annual National Prayer Breakfast, where he also spoke out on abortion and school prayer, and paid tribute to God for saving his life last March 30.

"Welcome home, soldier," Reagan said, paying tribute to the gallantry of the Army general, who was seized by Italian Red Brigade terrorists in Verona on Dec. 17.

Then the oldest man ever to enter the presidency noted that his 71st birthday is coming up Saturday and joked that many Biblical figures were active when much older. Moses was 80 when God called upon him, and Abraham, who was 100 when Isaac was born, lived to be 175, the president said. "Just imagine if he had put $2,000 a year into his IRA account," Reagan said.

He went on to tell the crowd of about 3,000 people at the Washington Hilton that there are trying moments in men's lives which God carries them through.

He and Dozier each have had such a moment, the president said, referring to the attempt on his life outside the same hotel and Dozier's kidnaping.

Reagan went on to back prayer in schools and attack abortions, speaking out on two social issues that critical conservatives say he has given only lukewarm support.

"God, the source of our knowledge, has been expelled from the classroom," Reagan said. "He gives us his greatest blessing, life, and yet many would condone the taking of innocent life."

After breakfast, Dozier rode with the president in a motorcade to the White House, where they posed for cameras in the Oval Office.

The 50-year-old general then held a news conference at the Pentagon, his last public appearance before two days of medical tests at Walter Reed, more debriefing and about two weeks of leave with his wife, Judith.

At the Pentagon, Defense Secretary Caspar W. Weinberger introduced Dozier as an officer who "brought the greatest credit to the uniform."

"At a time when the country sorely needs heroes," Weinberger said, "Gen. Dozier is a genuine hero."

In unemotional words, as though he were giving a briefing on a less personal and dramatic episode, Dozier described how an apartment housed a blue, cabana-style tent in which he was held chained to a cot in one half while a guard kept watch from a chair in the other half.

He said he learned that he was being tried by a "people's court" when he read a copy of Time his captors brought him. The trial, he said, consisted of a series of questions from "a little guy" who sat in a corner of the tent and occasionally was prompted by others outside.

At no time did his captors tell him he would be killed, and they brought him an Italian newspaper on his third day to back up their statements that his wife was alive and at liberty.

They had taken several personal papers from his apartment, however. "Probably the thing that's most distressful right now is they took all of my 1981 income tax information," Dozier said. He said he told Reagan of his loss and the president replied: "Good luck."

His captors brought him two decks of cards and numerous books in English. "When I was liberated, I was reading George Orwell's '1984,' " Dozier said. That grim view of the future cannot be recommended for prison reading, he said.

The end came quickly. He was dozing on his cot about 11 a.m. on Jan. 28 and the man guarding him was wheezing and coughing because of an allergy. Sometimes the guards nodded off, the general said, with a hint of disdain for anyone who falls asleep at his post.

The tent billowed, as it always did when the door of the apartment was opened. Dozier looked up and saw the guard looking out the tent door while holding a pistol "pointed loosely at me." Dozier said he moved off the cot into a corner of the tent as best he could with one wrist and one leg chained to the cot. In less than 90 seconds from the moment the door opened, an Italian policeman barged into the tent, knocked the Red Brigade guard to the floor and disarmed him, Dozier said.