The skidding stock market has battered down the price of shares in many Washington companies by 20 to 35 percent in the past two weeks, sending stockholders scurrying for more stable investments.

Allegheny Airlines - off 36 percent - Quality Inns International - off 33 percent - and Macke Co. - off 31 percent - have been among the hardest hit. The Johnston Lemon index of 30 local stocks is off 15 points, dropping from 115 to 90 in 10 days of trading.

Many investors have switched from secondary and growth stocks to investments linked directly to high interest rates - Treasury bills, money market funds, bonds and even high-yield certificates of deposit, brokers report.

But there was strong evidence of buying interest yesterday, brokers agreed, as investors sought bargains in stocks whose price have been knocked down by the market trend despite good news from the companies.

Washington securities dealers suggested the market slide was exaggerated by two factors:

Selling in anticipation that President Carter will sign the capital gains tax cut bill which, as Bill Jones of Legg Mason Wood Walker Inc. pointed out, will also reduce the deduction for investors who have capital losses.

Selling to meet bargain calls, as investors who bought stock on credit found the value of their shares had dropped to the point where they had to either put up more money or sell.

"This is the first time we've ever gone into a unison decline that we've only had a 50 percent margin requirement," said W. James Price, a partner in Alex Brown & Co. of Baltimore. Most brokers issue calls when an investor's equity drops to 30 to 35 percent of the investment, he explained. With a 65 percent margin requirement, that means a loss of almost 50 percent of the value of the stock, but with a 50 percent margin, the call comes when the loss hits about 25 percent of the stock's value.

Julia Walsh, president of Julia M. Walsh and Sons, said the margin call problem has not been as great in Washington as elsewhere, "Because Washington investors are fairly conservative."

The index of local stocks compiled by Johnston Lemon & Co. has roughly paralleled the Dow's decline, said Custis Hoge, the broker who charts that measure of the market.

The big losers among local issues - Allegheny, Macke and Quality Inns - have been balanced by more moderate declines in issues like Garfinckel, Brooks Brothers, Miller & Rhoads - down from 25 1/4 to 21 - Marriott Corp. - down from 14 3/4 to 12 - and Woodward & Lothrop - down from 32 1/4 to 28.

Local bank stocks have remained strong, Walsh prointed out, and Hoge noted that Washington utilities have held up well in the past month. Potomac Elecric Power Co. is down less than a point, from 14 5/8 to 14 and Washington Gas Light is off from 26 3/8 to 24 1/4.

Utility stocks are purchased primarily as income investments, Hoge explained, and their yields remain competitive with other interest-sensitive investments.