For some it's the ultimate nightmare: You're in a strange town and you're out of money. Your personal check is as good as a $3 bill; your hotel (restaurant, shop, hospital, gas station, taxi, etc.) doesn't accept your brand of credit card. At times like these, Karl Malden won't come to your rescue. What you need is cold hard cash -- and fast. But where can you get it at 2 a.m.?

Back home, you could have called a friend or used your plastic card in the automatic teller machine (ATM) of your friendly local bank. But on the road . . .

Don't despair. Nineteen eighty-one is likely to go down in financial annals as the year in which cash finally became universally available.

Thanks to the advanced technology of interstate electronic-funds-transfer systems and the ambitious initiatives of national credit card companies, a traveler soon will be able to insert a magnetic card into one of many terminals anywhere in the country and withdraw cash from his or her home bank account. In some cases, it may be possible to get a cash loan from the machine.

At the moment there are numerous regional ATM systems. Several months ago, the American Banker, a trade paper, counted 100 multi-institution, electronic-funds-transfer systems throughout the country. Among the largest are the TYME (an acronym for Take Your Money Everywhere) system in Wisconsin and neighboring upper Michigan, with its 250 terminals shared by 313 financial institutions, and the Rocky Mountain Bankcard System of Denver, in which 200 institutions participate.

Interchange across state lines has reached "epidemic" proportions on the West Coast, according to the publication. Western Bancorp of Los Angeles is creating an 11-state, 900-branch system with several hundred ATM machines. Closer to home, Financial General Bankshares operates 65 terminals at 50 branches of the three First American Banks in the District, Maryland and Virginia.

The question now is whether these regional systems will continue to develop, eventually reciprocating with one another, or whether national organizations will take them over or create their own systems. Given the evolution of the credit system from one of local and regional charge cards to one dominated by national giants, the outlook for regional networks may not be too bright in the long run.

American Express, MasterCard and Visa all recently have announced plans to set up nationwide instant-cash services.

Starting in July, American Express will expand the functions of its Gold Card to enable customers to obtain $500 a week from an ATM machine at any one of the 149 locations in 16 major cities. Eventually that will be expanded to 30 cities. The machine gains instant access to the customer's account at the bank that issued the card.

The minimum income required to apply for a Gold Card is $20,000 a year; the annual fee for the card is $50. A Gold Card holder currently can use it to purchase traveler's checks at airport terminals and to cash a $1,000 personal check or get a $1,000 line of credit at 11,000 offices of participating banks in the United States and Canada.

Interbank Card Association, which franchises MasterCard, announced recently it would begin a pilot national ATM interchange system in November. The sole function will be to allow cardholders to get cash from bank machines where the MasterCard logo is displayed. The new function will be added to all existing MasterCards.

Visa USA is looking cautiously at late fall or the beginning of next year as its target date for an ATM sharing program. The company is investigating several cards that can be used in ATMs, including a new travel and entertainment card for affluent customers. (This is Visa's answer to the American Express Gold Card.) According to a Visa spokesman, the amount of the withdrawal authorized is determined by the issuing bank at which the customer has the account, subject to a reasonable limit put on by the accepting bank so as not to deplete its reserves. Of course every cash advance will have to be approved by the issuer. The whole authorization process will be completed in an average of three seconds.

The Carter administration recommended that curbs on electronic transfers between states be relaxed first. When and if this happens -- and the Reagan administration seems to be leaning in that direction -- "interstate banking can occur at the flick of a few switches," in the words of the American Banker. Yet by the time regulated banks are permitted to engage in interstate banking, they may find unregulated credit card companies, brokerage firms and retailers already have flicked that switch.