LONDON (AP) _ Margaret Thatcher said Tuesday that South Africa has taken ''very considerable steps'' toward ending apartheid, and called economic sanctions ridiculous. Opposition lawmakers shouted that she had ''blood on her hands'' for supporting the white-minority government.

The prime minister was defending a Commonwealth summit agreement that, as a result of Britain's efforts, adopted only limited sanctions on South Africa, which has been torn by violence against white rule for 14 months.

Its plan calls for tougher measures in six months, but Mrs. Thatcher has said her government will do no more.

She rejected demands by the opposition Labor Party that she meet with Oliver Tambo, leader of the African National Congress guerrilla movement, who is visiting Britain. Mrs. Thatcher refuses to see Tambo on grounds he espouses violence.

''I do not accept that apartheid is the root of violence ... nor do most other people. How else can you explain the violence in Uganda?'' Mrs. Thatcher snapped at one questioner.

After her speech, Tambo appeared before the foreign affars committee of the House of Commons, pleading for a total economic embargo against South Africa.

Tambo rejected repeated challenges from governing Conservative Party legislators to condemn guerilla attacks and the murders of black policemen, local officials and their families by black mobs in South Africa.

''One thing we are not doing is attacking cinemas and attacking children,'' said Tambo. ''But we will attack the police and we will attack the military, and in the process it is inevitable that innocent people will die.''

In a statement to the House of Commons, Mrs. Thatcher said the accord reached by the Commonwealth, the 49-nation asssociaton of Britain and its former colonies, at the summit Oct. 16-22 in the Bahamas was a ''major success ... for the wisdom of going for the path of negotiation and not violence.''

The accord also provided for a group of ''eminent persons'' to try to get negotiations started between President P.W. Botha of South Africa and that nation's black leaders.

The mild, immediate sanctions represented a major compromise compared with African and Asian leaders' demands for tough measures or even a comprehensive embargo because of apartheid, the race laws with which South Africa's 5 million whites retain power over the 24 million blacks.

Mrs. Thatcher agreed to three minor new measures, including a possible ban on the import of Krugerrand gold coins, which amounts to about $715,000 annually.

''I can see little point in sanctions creating more unemployment in this country only to create more unemployment in South Africa. . .. It seems to me a ridiculous policy that would not work,'' she told the Commons.

She contended that South Africa's militant black neighbors, which depend on it economically, were secretly glad she succeeded in blocking tougher measures.

''There was a good deal more reality than might appear from some of the rhetoric,'' the prime minister said of the Commonwealth summit.

''I think many people there realized that sanctions would also be ... very damaging to African countries who have (increased) their trade with South Africa over previous years and they too have preferential trading agreements with South Africa that they do not wish to stop.''

Mrs. Thatcher fended off accusations by Labor Party members for 40 minutes, while rank-and-file Conservatives fed her leading questions about one-party states in black Africa and reform measures announced by South Africa.

''The present South African government has taken more steps to start dismantling apartheid than any of their predecessors,'' she said, citing the abolition of bans on interracial sex and marriage, proposals to scrap laws that restrict the movement of blacks in white areas and to grant citizenship to some blacks. The citizenship would not include voting rights.

Opponents of apartheid dismiss the moves as cosmetic measures that leave the racial segregation system intact.