It’s a possible but not that straightforward process.
First of all, there should be enough opening (at least twice as wide as the door). On top of that, you need to have the room/space to hide the door inside the wall itself.
You may need to relocate the electric outlets or wires if there is any.
You must buy high-quality, pocket door hardware.