Danny McBride, left, as Neal Gamby and Walton Goggins as Lee Russell in “Vice Principals.” (Fred Norris/HBO)

If you can get through the first two puerile episodes — and that’s a big if — of Danny McBride and Jody Hill’s mean-spirited school comedy “Vice Principals” (premiering Sunday on HBO), you’ll probably notice a much better and possibly smarter work of satire lurking just out of reach.

“Vice Principals” first comes across as a show with only one joke to tell, like something that crawled from a septic tank filled with VHS copies of long forgotten ’80s comedy films, with McBride (“Eastbound & Down”) starring as Neal Gamby, a foul-mouthed, thick-headed oaf who happens to be vice-principal of North Jackson High School, somewhere in a leafy-green Southern suburb.

After the resignation of North Jackson’s principal (Bill Murray in a brief cameo), Gamby feels certain he’s next in line for the job, were it not for his unfriendly rival, Lee Russell (Walton Goggins), a ferociously fey vice principal who also feels entitled to the promotion.

Both men, unanimously loathed by their colleagues and students, are surprised when the superintendent hires a highly regarded Philadelphia educator, Dr. Belinda Brown (Kimberly Hebert Gregory), for the job. Determined to get the new principal fired, Gamby and Russell form an unholy alliance, deploying a series of cruel schemes that might have once seemed comedic but instead come across as far too extreme — especially since their ire is directed at a black woman trying to run a school.

It’s not long before the two men break into her house, destroy it and set it on fire. On another occasion, they pose as vandals from a rival school and spray-paint a depiction of Dr. Brown’s vagina on the school walls with derogatory language. “When the time’s right, I’m gonna stab that b---- in her big, fat back,” Russell tells Gamby.

Laughing yet? Only after you’ve heard enough (and endured more of McBride and company’s misplaced faith in blunt, overly broad humor), does “Vice Principals” make an interesting pivot, taking us briefly into the world of Dr. Brown. After the house fire she and her sons move into a motel, where she briefly considers resigning and moving back to Philadelphia. Does she have the resolve to stay and fight?

It’s really not a critic’s job to write a review of a show that might have been, but “Vice Principals” is one of the rare occasions when I can’t help but wonder what it would look like if it was recut as a more serious, dark comedy called “Principal,” about a minority female administrator who gets assigned to a school where two of her white male colleagues are trying to undermine her authority. Gregory is terrific as Dr. Brown — and the only times I laughed out loud at “Vice Principals” came during scenes in which she outsmarts her adversaries.

Perhaps that’s by design. “Vice Principals” also improves in later episodes when it shifts its focus away from inane, acrimonious stunts and delves deeper into Gamby’s and Russell’s private lives and their self-inflicted emotional wounds. (It’s telling that Dayshawn, a friendly, pot-smoking cafeteria worker played by Sheaun McKinney, assumes that the reason Gamby and Russell keep sneaking off into the woods behind the school is because they are secret lovers.) As with “Eastbound & Down,” McBride is best when his character’s outsize ego gets bruised or brought low.

“Vice Principals” is the third cable comedy this year set in the public-school milieu (including TruTV’s “Those Who Can’t” and TV Land’s “Teachers”), following a dismal tradition of dumb films and TV shows that collectively denigrate the teaching profession. I suppose comedians may very well carry lingering animosity toward the teachers and administrators who didn’t appreciate their earliest material, but these shows often fail to do their homework, presenting situations and characters that never reach the verisimilitude of other painfully real satires, the way “Veep” nails politics, or “Getting On” understood hospitals, or “Silicon Valley” imbues (and then skewers) the tech industry.

“Vice Principals” almost becomes a show like those — and it may yet still, if it would just straighten up and fly right, as one of the principals who haunts my teenage memories used to say.

Vice Principals (30 minutes) premieres Sunday at 10:30 p.m. on HBO.