The campaign was created by Abbott Mead Vickers BBDO, one of several spots to promote Radio 4 comedy. In it, Vegas was shown sitting in a fridge passing out the ingredients for someone to make a pizza before the fridge door is shut in his face.
The viewers who complained said that they felt it was dangerous to show a fridge door closing on someone because children might copy the example.
The BBC told Ofcom that it had been careful to keep the promotion away from CBBC and other children's programmes. Nonetheless, it did appear alongside programmes that were likely to attract a significant number of younger viewers.
It said that it had reacted swiftly to concerns and moved the promotion to after the 9pm watershed.
Ofcom ruled that it had been in contravention of the code on standards and said that the complaints were upheld.
In a statement, the regulator said it welcomed the BBC's action in removing the promotion from pre-watershed broadcasts.
"Promotions come upon the audience without warning and, in this case, there was the added possibility that children may not initially understand the comic situation and be able to assess the action's potential for harm," Ofcom said.
Last week Ofcom upheld complaints against the ITV programme 'Ministry of Mayhem' where a presenter encouraged viewers to feed lemon juice to babies.
If you have an opinion on this or any other issue raised on Brand Republic, join the debate in the .