Wayne Rooney's goal gave United a 1-0 third round replay victory, but Allardyce was enraged by two penalty decisions by Phil Dowd.
The referee waved away West Ham's claims after an apparent handball by Rafael, and later awarded United a penalty for a Jordan Spence handball - Rooney blazed the shot over.
Allardyce told ITV: "There's no doubt about the difference between Rafael's handball and Jordan Spence's.
"Spence plays for West Ham and the away team, while Rafael plays for the home side at Old Trafford.
"With Rafael, the ball hits his hand but no penalty is given. With Jordan Spence, the ball hits his hand and it's a penalty. You see it time and time again at Old Trafford.
"The ref did not see Rafael's handball because of his position. But he was in a worse position to see Jordan Spence's than Rafael's."
Ferguson expressed his disappointment at Rooney's miss, which was United's fifth penalty failure in nine attempts this season.
He said: "I don't think it is just one of those things. I think we have to improve at that.
"If you get a penalty kick, really... there has been talk about (the good penalty record of) Rickie Lambert at Southampton. That is what taking penalty kicks is about.
"There have been several great examples over the years - Matthew Le Tissier scoring 47 out of 48.
"A penalty kick is your opportunity to take advantage of a foul or a handball or whatever and score a goal."
Rooney's penalty record for United stands at 17 out of 26.
- Sports & Recreation
- Jordan Spence
- Wayne Rooney