I am not aware of any official rules sources or developer statements that would answer this question definitively. So this answer will necessarily be a bit of synthesis.
The cockatrice of D&D is, of course, based on the mythical creature of the same name, and some legends did have the corpse of one of those continue to petrify creatures. The quintessential rogue-like game Nethack features a great deal of D&D-derived material, and cockatrice corpses in that could be a potent weapon, provided the user was somehow protected from petrifying themselves while wielding it.
Furthermore, the cockatrice’s petrification attack isn’t terribly powerful—you have to fail two Constitution saving throws at DC 11 in a row, which is pretty unlikely for the vast majority of targets. And even when it works, it takes two turns, which matters—it’s not a way to just summarily remove targets from the fight.
Still, I’d be leery about this. Being petrified is as good as being dead, and though it takes two turns to take hold, and is rather unreliable, being able to fling this at some target for just one attack, and potentially have them removed from the fight after two rounds of focusing on other targets, is potentially highly advantageous. My primary concern would be that it just becomes a little too predictable—every fight starts with chucking the cockatrice-javelin. Neat, fun tricks can get old pretty fast if you let them get predictable.
My solution here would be to have the body slowly decay and lose its potency, forcing the characters to eventually abandon it, or at least invest in casting gentle repose on it. Even then, I might say it only has so many shots of petrification left in it. The characters could, I dunno, start a cockatrice farm for this, but at that point I might be comfortable with them maintaining the tactic.