It might need more energy than you would spend mining it from a distant star system, or release enough heat to melt the factory, the crew, and the planet it's on, but, still, there is no fundamental law of physics preventing you from doing it.
And then there is the question of scale and sustainability. Recovering hydrogen from what is essentially a product made from fossil fuels to then burn it is not really that helpful. And there is only so much plastic out there that we can recover. At best we get a second use out of the fossil carbon before it is released back into the atmosphere. But you could argue that a landfill at least captures the carbon more permanently. So, labeling this as green or sustainable would be a bit of a stretch of the definition.
There was a recent posting here about a company in this space using pyrolysis to break down the inputs but had serious issues in emissions from the plant.