Brazil has attacked the UK and developing nations after returning a ship which they claim contained toxic waste.