Dominion Bankshares Corp. of Roanoke plans to buy the National Bank of Commerce of the District in a cash transaction worth $15.2 million, officials of the two banking firms said yesterday.

Dominion's offer to buy Bank of Commerce is the fifth interstate merger agreement to be signed by banking firms in Virginia and the District since reciprocal banking laws were passed in both jurisdictions last year. United Virginia Bankshares Inc. of Richmond acquired NS&T Bankshares Inc. in December. Still pending are merger agreements between Sovran Financial Corp. of Norfolk and D.C. National Bank; James Madison Limited and The McLean Bank of Northern Virginia; and Bank of Virginia Co. and Security National Corp. of D.C.

If approved by shareholders and regulatory agencies, the agreement signed by Dominion and Bank of Commerce would be Dominion's second acquisition across state lines. Dominion announced in November that it had agreed to buy State National Bank of Rockville.

Under terms of the agreement reached yesterday, Commerce Bancorp would be dissolved as a holding company and National Bank of Commerce would change its name to Dominion Bank of Washington N.A. The bank would continue to operate under present management and a local board of directors.

The purchase price is about 2.4 times the book value of National Bank of Commerce, the subsidiary of Commerce Bancorp Inc., a D.C. bank holding company. Although small, Bank of Commerce is expected to provide a profitable base for Dominion's entry into the District, said Warner N. Dalhouse, Dominion's president and chief executive officer.

National Bank of Commerce, formerly Bank of Columbia, operates three offices in the District and had assets of $85 million at the end of 1985.

Bank of Commerce has about 300 stockholders, but most of its stock is owned by a group of investors headed by local real estate developer Jeffrey Cohen, who took control in 1981. Cohen owns 38 percent of the stock in Bank of Commerce.

Dominion Bankshares is a $4.7 billion holding company that operates five banks in Virginia.