Yes, you absolutely can, especially in an old diesel engine, they can run on all kinds of oil. But the engine might not fare well, depending on the properties of the oil, and the exhaust might contain "interesting" stuff like dioxins, depending on what was in the mystery plastic to begin with.
I would say if this could be done by some utility company, that company could have diesel engines to generate power from that oil which could have filters and all that stuff.
I assume it still could be profitable because people who want to get rid of plastic waste would still have to pay. Getting excess power from grid is also something one would get paid for. Then turning on generators when grid needs power to get paid when there is a power shortage.
But as I write this out I imagine that it would require massive amounts of investments for setting up such operation and getting all kind of permits or environmental studies and god knows what. Let alone getting deals with electric companies - so I think that would be something that some electric company would have to set up. They would most likely have most know-how for such setup.
Meanwhile, the power company in this city burns plastic (and all kinds of waste) in their co-generation plant and gets electricity and residential heating.
There's an argument to be made here for refurbing the best of the container ship engines after the ship hulls reach end of life.
The higher end engines are three storey high multistaged diesel engines with filters, scrubbers and some of the highest bunker oil -> power efficiencies on the planet.
They're ideal for generating baseload power and worth the rejuvenation effort.
Most (80% was the number I saw) large bunker-oil engines with scrubbers installed simply dump the removed sulphides into the sea as wastewater instead of venting it into the atmosphere. Not to mention the colossal amounts of carbon-related pollutants.
Solvable problems via a retrofit to be sure, but overall I'd rather than the HFO's are simply not burned at all.