Defying Prime Minister Margaret Thatcher and Parliament, the British Olympic Committee decided today to participate in next summer's Olympic Games in Moscow.

Its vote to "accept forthwith" the invitation to send a team of British athletes to Moscow is the first by an Olympic Committee of an American ally and a serious setback for President Carter's campaign for a boycott of the Moscow Games in response to the Soviet invasion of Afghanistan.

Thatcher has been the most outspoken allied supporter of the boycott campaign, and her government had brought every possible pressure to bearon the British Olympic Committee, including a 2-to-1 vote by Parliament just a week ago backing her request that British athletes stay away from Moscow.

Today's decision could make it more likely that independent Olympic committees of other Western European nations also will vote to go to Moscow whether or not their governments eventually ask them to boycott the games.

This is what delegates from the committees of France, Italy, Spain, Belgium, Ireland, Sweden and Finland said they would do at a meetings last Saturday of European Olympic officials in Brussels. Delegates from West Germany, the Netherlands, Switzerland, Luxembourg and Turkey said they were waiting to see what their governments' sports officials advised. In Western Europe, only the Norewegian Olympic Committee has so far agreed to boycott the Moscow Games.

Although final decisions on invitations to the Summer Olympics do not have to be made unitl late May, British Olympic chairman Sir Dennis Follows said his committee acted today "to remove the uncertainty our Olympic athletes have faced" and to give his committee time to raise more money to send a full British team to Moscow. Government pressure had discouraged many would-be corporate contributors to the British committee.

Voting in favor of accepting the invitation were representative of 15 Olympic sports here, including track and field, in which Britain boasts several outstanding competitors led by world mile record-holder Sebastian Coe. Only the Field Hockey Federation opposed the decision, while officials of four sports -- swimming, yachting, fencing and riding -- wanted to wait until May before making a decision.

The British government immediately appealed to individual athletes to ignore the Olympic committee and stay home.

"They are still free to decide their own course of action," said a government spokesman. British officials have ruled out "oppressive measures" to stop British athletes, spectators or television networks from going to Moscow.

British Olympic Committee officials said a last-minute appeal was made to them here last week by President Carter's chief Olympic boycott lobbyist, White House special counsel Lloyd Cutler, on his way back from a meeting in Geneva to try to launch an alternative "post-Olympic international sports festival."

Follows said today, "We made it very clear we are not interested in alternative games." He belittled the idea as an unworkable "mistake" made by politicians interfering in sports.