President Reagan indicated to Republican congressional leaders yesterday that he would veto any farm bill that allows farmers to vote on a program to curb agricultural production.

The president also told the GOP farm-state lawmakers that he will continue to insist that the bill meet budget requirements but will be flexible on how they are met.

Senate Majority Leader Robert J. Dole (R-Kan.) said that the term "veto" was not used but that Reagan expressed particular "disapproval" of a section of the pending House farm bill that would allow farmers to vote for higher price supports in return for sharp production cuts.

But Rep. Edward R. Madigan (R-Ill.) added that Reagan "made it very clear to us that if that mandatory referendum . . . is in the bill, that he would be absolutely obliged to veto the bill. He could never sign a bill with a provision like that in it."

Legislation expected on the House floor next week would establish a mandatory wheat and feed grains production-control program if at least 60 percent of farmers approve it in a national referendum.

The control plan, proposed by Rep. Berkley W. Bedell (D-Iowa), would bar nonparticipants from selling grain on domestic markets. They would, however, be free to use the grain on their own farms or to sell it overseas. Throughout the farm bill debate, the administration strongly opposed proposals that would have led to mandatory controls. Bedell's amendment is included in the House bill as an alternative to the current price-support loan program.

Yesterday's White House meeting, set up at Reagan's invitation, included House Minority Leader Robert H. Michel (Ill.), Senate Agriculture Committee Chairman Jesse Helms (R-N.C.), Vice President Bush and Agriculture Secretary John R. Block.

"The emphasis was on what we can do to get a bill," Dole said. "I think the president was trying to send out a signal that he wants to try to work out a bill."