Prime Minister Indira Gandhi will visit Washington for the first time in more than a decade next week, and she apparently is determined to ease the strains that have intensified between India and the United States since she returned to power 2 1/2 years ago.

"My major aim is to try to convince people in America that you can have friendship even if you do not agree on all matters," Gandhi said in an interview with The Washington Post during which she continually emphasized the possibility of developing closer, stronger ties.

In a startling turnaround, Gandhi even embraced a Reagan administration position she had previously spurned--that the United States could have friendly relations with both India and Pakistan, two neighbors who have fought three wars since they both gained independence almost 35 years ago. Gandhi had rejected that view as recently as last August when U.N. Ambassador Jeane J. Kirkpatrick visited India amid great Indian anger at the projected sale of U.S. F16 fighter-bombers to Pakistan, a sale India denounced as a threat to stability in the region.

Although she still disapproves of the sale, "we don't want the U.S. to give up its friendship with Pakistan," she said. "But we don't see why that should affect its attitude toward us," said Gandhi.

A senior American diplomat here viewed this new accommodation as one element in Gandhi's attempt to move India into a more centrist position within the Third World and to counter an impression in the United States that India is a Soviet proxy.

Another factor in her conciliatory attitude could be reports of preliminary discussions on a joint project for coproduction of the Northrop Corp.'s F5G jet fighter in India, a deal that would reduce India's dependence on Moscow, its major arms supplier.

Northrop, according to reliable sources, obtained State Department authorization to discuss the possibility of such a project with India and a Northrop team has visited India.

A State Department source in Washington said Wednesday that "very preliminary" discussions had taken place between Northrop and Indian officials several months ago.

India also has been discussing the purchase of U.S. C130 transports, howitzers and TOW missiles during the past 18 months, but informed sources point out that the difficulty in those discussions, and in any ultimate negotiation on the F5G, remains the improbability of private U.S. firms being able to match the highly favorable terms the Soviets give New Delhi. In addition, the United States is not normally interested in coproduction deals with countries that are not U.S. allies.

Gandhi's policy change on U.S. ties to Pakistan provides the clearest evidence of her government's desire to improve relations with Washington, which even a year ago were at such a low ebb that U.S. Charge d'Affaires Archer Blood warned the American community to expect an intensification of anti-American feeling in the country.

Since then, however, there has been what a senior American diplomat here sees as a distinct toning down of the official and the unofficial anti-American rhetoric.

There have been indications here that Gandhi has resisted Soviet overtures for closer ties while being careful not to annoy India's major arms supplier and its second largest trading partner after the United States.

Nonetheless, Gandhi balanced her Washington trip with word that she had accepted a long-standing invitation to visit Moscow, probably in September.

Gandhi will arrive in Washington July 28 after a day in New York. She will confer with Secretary of State George P. Shultz and meet with President Reagan the next morning.

The two leaders met for the first time during the Cancun economic summit last October and by all accounts developed a quick rapport.

Acknowledging that the two hold points of view that are antithetical, Gandhi said in the interview that "I seem to get on, you know, with most people, contrary to the image that the press propogates."

Gandhi said it is impossible for India and the United States to agree on everything, but "what sometimes disturbs us about the U.S.A. is that it feels, either you are with us 100 percent or you are against us. I think that is a very unfair way of looking at things."

Both American diplomats and Indian officials have sought to lower expectations for the visit, emphasizing that mostly atmospherics and little of substance is anticipated.

"All we expect," said Gandhi, "is better understanding."

"There is a feeling here that they the Americans are not really bothered about India," she continued later during the 40-minute interview at her office.

"I am not saying it about the present administration, but there have been periods, especially when I was in America last, when they felt that Pakistan and China were terribly important to them and, because India did not get on so well with those two countries, it was better to ignore India. Now our only answer is that we don't think one friendship should exclude another."

There are indications here she will concentrate in her talks with Reagan and Shultz on persuading them to change U.S. policy on interest-free loans for India's economic development.

India, the largest borrower of World Bank funds, traditionally has received 40 percent of the money from its soft-loan affiliate. Because of Reagan administration cutbacks, however, India has been forced to go to the World Bank's commercial rate window.