In a 2012 interview, Mel Brooks said that he wasn't allowed to sell Spaceballs merchandise because of an agreement with George Lucas and "Star Wars":
AVC: That’s a real thing now, by the way. People sell headphones that look like the Princess Leia buns.
MB: Incredible. I wasn’t allowed to do any merchandising. Even though my character said, “Merchandising, merchandising, the thing that really makes money.” I wasn’t allowed to do that. My deal with Star Wars was “no action figures.” Because mine were like, Dark Helmet. Rick Moranis was in this giant helmet head. No merchandising. I said okay.
As far as I understand it, the deal basically was "we don't sue the heck out of you for using our intellectual property (parody or not), if you don't compete with us on the toy shelves". Additionally, George Lucas' company was hired to do the post production of the movie:
AVC: Was that because George Lucas had sold merchandise, and the studios were apprehensive about a similar deal?
MB: Oh, absolutely. Fox and Lucas were making a fortune, and this really, you know, was stealing. [Laughs.] I stole a lot, and I satirize it, but the script was different. And [George Lucas] loves it. He loves the film. I was very wise. You know what I did not to have any real trouble? I called Lucas and I said, “I want you guys up in San Francisco—at the ranch or whatever—to do all the post-production of the movie. And he said, “Oh, great, great.” So, there may have been five million bucks in post-production on that, and special effects, etc., that Lucas handled. So, it was wise, you know? I was playing ball with the people who could have said no. [Laughs.] He wouldn’t have sued me anyway. He’s not that kind of guy. He wrote me a lovely note saying me how much he loved the picture. He said it’s dangerous comedy. He said, “I was afraid I would bust something from laughing.” Which is a lovely note.
Today, you can find some Spaceballs merchandise on the respective platforms, like shirts and mugs and stickers and so on. But I have my doubts about the legality of those products. Probably, neither George Lucas / Disney nor Mel Brooks authorized those ;)
EDIT from December 2021: Mel Brooks gave a bit more detail on Lucas' reasoning in a book excerpt on Literary Hub this month
Speaking of action figures… the same way I called Alfred Hitchcock to get his blessings on High Anxiety, I sent the Spaceballs script to Star Wars creator George Lucas. If not to get his blessing, then certainly to give him a heads-up on what I was doing vis-à-vis Star Wars. He was kind enough to read it and respond.
He said he had seen Blazing Saddles and Young Frankenstein and was a big fan. He enjoyed the script, and only had one real caveat for me: no action figures. He explained that if I made toys of my Spaceballs characters they would look a lot like Star Wars action figures. And that would be a no-no for his lawyers and his studio’s business affairs department. So he gave his blessing to make my funny satiric takeoff of Star Wars as long as I promised that we would not sell any action figures.
So basically, because the Spaceballs characters were (by definition) knock-offs of characters from Star Wars and other franchises, Spaceballs action figures would almost necessarily be knock-offs of Star Wars action figures. And that was the big no-no.