Two weeks after Prince Charles was the target of several thousand shouting pro-Irish demonstrators in New York, his aunt, Princess Margaret, has canceled a trip to Washington to raise money for London's Royal Opera House. The princess acted "on the advice of the government" and after consultation with the British Embassy in Washington, because of fears of further demonstrations, her press spokesman said yesterday. b

The queen's younger sister had been scheduled to attend the Royal Ballet's gala opening-night performance at the Kennedy Center on July 14, just as Charles had done in New York. She was then going to spend the next two days making other appearances to promote the fund for extensive backstage renovations at the Opera House in Covent Garden for the Royal Ballet and Royal Opera. Princess Margaret is a patron of the Royal Ballet.

But her press spokesman announced yesterday that Margaret has decided instead to return home directly from Canada on July 13, after a week's visit there.

A spokesman for the Royal Opera House said yesterday that officials there were disappointed, "but we can understand the government's reasons for advising her not to go."

Officials said the government was concerned both about Princess Margaret's safety and about the potential media impact of more demonstrations protesting British rule of Northern Ireland. During Prince Charles' one-day visit to New York, crowds estimated at between 3,000 and 4,000 strong carried anti-British placards, threw eggs, banged garbage lids on the street and shouted abuse at the prince at Lincoln Center.

It was also remembered here that Princess Margaret became the center of a storm of protest during her last American tour in 1979. It was reported that the princess told Chicago Mayor Jane Byrne at a dinner following the death of Lord Mountbatten in an IRA bombing that the "Irish are pigs." The rest of her trip was dogged by demonstrators demanding "Scram, Margaret" and "Brits out."

This month's protests against Prince Charles made a bigger impact in Britain than in the U.S., dominating television reports and newspaper front pages here the next day. The Times of London even reported erroneously that demonstrators in the Lincoln Center audience had stopped, rather than disrupted, the Royal Ballet performance attended by Prince Charles and Nancy Reagan.

Politicians and commentators here reacted especially angrily to New York Mayor Ed Koch's call for British withdrawal from Northern Ireland and his public discussion of a private conversation about the subject with Prince Charles. Breaking the confidentiality of royal conversations is a cardinal breach of etiquette in Britain.