Sen. Edward M. Kennedy (D-Mass), today called on President Carter to issue a veto ultimatum to Congress in the name of a strong oil windfall profits tax.

As a rally crowd cheered him on, Kennedy said the president should warn Congress promptly that, if it enacts an oil windfall profits tax of less than 50 percent, he will veto the bill and reimpose the oil price control he lifted unilaterally earlier this year.

Kennedy's attack on the Carter oil price policy marked the second time in two days that he has publicly soundd a call for action aimed at the president he hopes to unseat. And Kennedy and his aides made it clear that he intends to leave similar toughly worded calling cards for Carter as he travels around the country in the days ahead.

Gone are the days when Kennedy would content himself with coy criticisms of those who advocate this policy or that. Now kennedy has entered what his aides concede is a more combative phase of his campaign. Friday, in Charleston, W.Va., it was a call for carter to issue a moratiorium on construction of new nuclear power plants. Today, it was a call for carter to issue an ultimatum in the name of his own windfall profits tax.

"I call on the president today to say to the Congress of the United States that he will veto any bill that doesn't provide a return at least 50 percent of the windfall profits . . . to the general Treasury and to the taxpayers of this country," Kennedy told a Buffalo campaign rally that was ostensibly to promote the candidacy of a Democrat who is running for county executive, but was instead dominated by Kennedy-for-president signs.

As the crowd of several thousand cheered inside the Buffalo Convention Center, Kennedy added, "That is the kind of message the oil and gas companies will understand."

But the president has no intention of heeding the Kennedy call, according to a senior Carter White House offical. "It's really a silly idea," the Carter official said. "It's totally political on his part . . . You'd wind up playing right into the hands of the oil companies."

He added that if a windfall tax bill were vetoed there would be no revenue to provide the funds for energy conservation aid to the poor, mass transit or alternative fuels such as coal research, which is what Sen. Kennedy talked about in a speech just one day ago."

Earlier this year, Carter began phased decontrol of oil prices and coupled that with his proposed tax to recapture about 50 percent of the windfall profits that the oil companies would reap once prices rose because of decontrol.

The House has adopted a windfall profits tax that is approximately what Carter wanted. But the Senate Finance Committee has approved a bill that, according to Kennedy's figures, would allow the oil companies to keep 71 percent of the windfall revenues.

Both Carter and Kennedy have been critical of the Senate Finance Committee's weaker windfall tax. but Kennedy criticized Carter for having allowed the problem to occur in the first place.

" believe we should have passed a windfall profits tax prior to the time that we were going to move toward decontrol," Kennedy said today, renewing a criticism he has leveled ever since Carter announced his decontrol program in April. "Any farmer knows you don't give the horse the sugar and then try to get him into the barn."

All controls on domestic oil prices would have expired automatically, under existing law, by Sept. 30, 1981. Carter's argument for beginning his gradual, phased decontrol in June was, in part, that the economy could not stand the steep, sudden price increase that would occur in 1981 if all oil price controls controls expired at once.

In a brief interview today after his rally speech, Kennedy said he believed there would be no cataclysmic damage to the economy in 1981 if controls were reimposed now, because the oil companies and the oil advocates in Congress would see to it that there was none.

"Reimposing controls . . . would put the monkey, on the back of the oil interests for a change," Kennedy said after the rally. "It would not be in their interests to have the prices rise so suddenly and so sharply [in 1981]."

He said he believes they would find some way to cushion the effect. Kennedy press secretary Thomas Southwick offered some elaboration, saying Kennedy believes that Congress, faced with the prospct of such an abrupt price rise, would be willing to approve an extension of controls after Sept. 30, 1981, to alow for their gradual removal at the time.

Kennedy flew to Buffalo at midnight Friday, after addressing a West Virginia Democratic fund-raising dinner, so that he could lend his personal support early this morning to an upstate New York Democratic boss who has fallen on hard times.

Joseph Crangle, Erie County Democratic chairman, is seeking to have his party regain the county executive's office and other top positions, and he had called Kennedy's office several times to ask the senator to make an appearance in the county just before the Tuesday election.

Kennedy came. And Crangle obligingly decorated the hall with huge signs promoting the Kennedy candidacy. His introduction ended with a ringing prediction that "in 1980 I'm confidant Erie County will prove to be an excellent friend of Sen. Kennedy."