''Granny flats,'' an Australian concept for housing elderly parents of grandparents near their children but with a measure of independence for both parties, are arousing interest in Washington and other parts of the United States.

As developed by the Australian state of Victoria, granny flats are low-cost, compact, factory-built houses that are rented by the state government to an elderly couple or individual and installed in their children's backyards. When the old people no longer need them, the granny flats are moved to someone else's backyard.

William E. Hanna, the mayor of Rockville, said he first heard of the idea about three years ago and, "I've been trying to get them here ever since. I wanted Rockville to be the first jurisdiction in the country to have granny flats."

About two years ago, Hanna persuaded the City Council to appropriate $60,000 for a pilot project. The mayor said he then tried to drum up matching funds but failed, "even though some people at HUD the U.S. Department of Housing and Urban Development thought it was the most innovative thing they'd heard of."

Hanna said one benefit of granny flats would be the "reestablishment of the extended family in America, where more than one generation live together and support each other, though no longer under the same roof."

With insufficient money to launch the project, the Rockville appropriation lapsed a month ago. But Hanna hasn't given up. He's been meeting with Reagan administration officials at HUD and plans to submit a new proposal to the agency in a week or so.

"We see the idea as an alternative to the elderly staying on in large, older houses which they no longer need and can no longer care for, as well as an alternative to their going into a nursing home," said Rockville community development specialist Edward Duffy.

In April, the Washington-based American Association of Retired Persons and the National Retired Teachers Association conducted a forum here on granny flats. "About 100 people attended," said Leo Baldwin, housing coordinator for the two organizations, "and since then we've had inquiries from about 500."

Australian town planner Barry W. Cooper, who spoke at the session, said the units were a success in Melbourne, where supplies were unable to keep up with demand from older people and their children. Since the program began in 1975, about 100 new granny flats have been installed annually, he said.

Paul L. Shepherd, director of the Senior Center Institute at the University of Maryland, said the concept was "obviously more appropriate to rural areas and certain suburban communities" than to cities, where space generally is inadequate and zoning restrictive.

Shepherd, who wrote a management plan two years ago for a proposed community of 100 granny flats to be installed as a cluster community in a rural section of Maryland's Eastern Shore, said an area such as the Eastern Shore is most suitable.

One of those who attended the forum was Edward W. Guion, who owns a woodworking company in Lititz, Pa., in the heart of the Pennsylvania Dutch country, where there's a precedent for this type of housing. The Amish who reside there have long had what they term grossmutter, or grandmother, houses on their farms. Guion said he'd first learned of granny flats in 1978, when he was approached by the Lancaster County Office of Aging. "They had heard of the Australian experience and they wanted to see what could be done here," he said. He drew up plans, but when the officials attempted to obtain a federal grant, they had an experience similar to Hanna's. So Guion put his plans "on the back of a shelf."

That's where they remained until county officials told him about the forum to be held in D.C. "I went along and came back with renewed vigor," he said. Guion then built a prototype, which he put on display in downtown Lancaster last Memorial Day.

"I sat in it and I'd say about 6,000 people came through," Guion said. "Over half of those who came in were young people. A lot of them said they could be comfortable in a small house like this and asked if they had to be old to buy one. It occurred to me that there's a much different market than I'd conceived of. There's a great need for affordable housing for the young as well as the old."

The prototype, which Guion calls an "elder cottage," rather than a granny flat, consists of a living room, bedroom, kitchen, bath and utility room, measuring a total 508 square feet. It's cost, delivered in the Lancaster area, installed on wooden pilings and connected with utility lines, is just over $18,000.

Hanna said he'd like to see the creation of a "national master design" through a nationwide competition to be held among retired architects. "That way," Duffy explained, "they could use not only their expertise as architects, but their intuitive feelings as elderly people."

Duffy pointed out that one of the more important features of a successful design would have to be its flexible external appearance. "It's important that it blend in with the main house itself and with the neighborhood. For example, a log cabin-look might not fit in some neighborhoods, while in others California-modern might be all wrong."

According to Baldwin, the name of the structure is important, too. "When we discussed the idea at our forum," he said, "one man came up to me afterward and said he thought it was a terrific idea but there was no way you'd get him to live in something called a 'granny flat.' He saw it as a put-down."

As a result, Baldwin said, he now refers to the units as Elderly Cottage Housing Opportunities, or ECHO, which also implies that the little house in the backyard echoes the appearance of the big house in front.