Oscar Hammerstein II is famed as the lyricist behind such wholesome Broadway classics as “The King and I” and “The Sound of Music,” but his legacy is now being tainted by allegations of sex and greed.

First, his grandson Simon Hammerstein opened The Box, a raunchy Lower East Side burlesque club where a lawsuit alleges he bullied twin dancers to perform sex acts on him in exchange for stage time.

Now, Simon’s mother, Dena, is accused in a new suit of trying to cheat her pal and longtime co-producer out of her cut of the highly anticipated “Honeymoon in Vegas,” opening on Broadway in November and starring Tony Danza.

Pam Pariseau says Dena Hammerstein, who, insiders say, used her surname to gain entry in the theater biz after marrying into the family, fired her while putting the musical together.

In her Manhattan Supreme Court suit, Pariseau says she herself had gotten Danza on board and “personally approached” composer Jason Robert Brown for the $10 million stage remake of the 1992 film.

Now with previews to start Nov. 18 at the Nederlander Theatre, Hammerstein, 73, refuses to give Pariseau, 48, her 20 percent cut or her co-producer credit, the suit alleges.

Sources say Hammerstein sees a windfall coming and wants to keep it for herself. A Broadway hit can generate $50 million a year.

Pariseau worked for Hammerstein’s production company for 12 years and organized galas for her Only Make Believe charity. She was paid $100,000 annually, on top of her 20 percent cut.

“It was a very tight relationship,” Pariseau said.

But in November 2011, after the pair attended a reading of a play, Hammerstein lowered the ax.

“She said, ‘How do you see your role in this production, moving forward?’ and, ‘I just think at this point I need more of an assistant,’ ” Pariseau recalled.

“I was shocked. And I think I said, ‘So you don’t see me having the same role as I’ve had in every production we’ve worked on for the past 12 years?’ ”

Pariseau now says she’s still stumped by her firing.

“I wish I knew,” she told The Post. “The question has kept me up nights.”