NEW YORK, SEPT. 30 -- Bear Stearns Cos. Inc. today became the second major Wall Street firm in a week to undergo an ownership shake-up when a subsidiary of the Hong Kong-based Jardine Matheson Group agreed to pay $391 million for a 20 percent stake in the firm.

The deal follows Salomon Inc.'s decision, approved by its board of directors Monday night, to sell 12 percent of the investment banking firm to investor Warren Buffett for $700 million.

Bear Stearns executives said today that while they did not seek an investment by Jardine, the transaction is a friendly one. Jardine has pledged not to raise its stake above 24.9 percent for three years and to acquire no more than 35 percent by 1992.

The deal developed six or seven weeks ago, according to Bear Stearns executives, when an intermediary approached the Wall Street firm suggesting Jardine might be interested in making a long-term investment. The final proposal was approved by the Bear Stearns board of directors this morning.

"When you're a public company, people have the right to buy your stock. I'm all for it," said Alan C. Greenberg, Bear Stearns' chairman. Greenberg conceded, however, that the alliance with Jardine offered his firm no obvious strategic benefits and no fresh capital. "We don't need any money," he said.

Greenberg, the only chief executive of a major Wall Street firm who still spends most of his working hours trading stocks and bonds, is principally responsible for the firm's reputation in the financial community.

While other large firms have recently been hampered by Wall Street's insider stock trading scandal or by management problems associated with rapid growth, Bear Stearns has seized the opportunity to recruit executives and move into new lines of business. An internal memo sent recently by Greenberg to Bear Stearns professionals said the firm intended to take advantage of hiring cutbacks by rivals to recruit top talent.

Some Bear Stearns professionals expressed disappointment about the deal today, saying it seemed primarily designed to allow senior partners to sell some of their shares for more than the open market price.

Jardine Strategic Holdings Ltd., a 46 percent owned subsidiary of Jardine Matheson, will make a $23-a-share tender offer for 20 percent of Bear Stearns' outstanding common stock. A partnership of Bear Stearns' leading executives, which controls about 45 percent of the firm, has agreed to tender its shares to Jardine.

In a partial tender offer such as the one Jardine will make, shareholders choose whether to offer their shares for sale. In this case, if more than 20 percent of Bear Stearns' shareholders decide to sell, the stock will be purchased by Jardine on a pro-rated basis.

The investment represents another step in a continuing international diversification program by the Jardine conglomerate. For decades the most influential corporation in Hong Kong, Jardine has been shifting capital abroad for several years, anticipating the 1997 takeover of the former British colony by China.