In my life BC i was a Nanny and I did a temporary trouble shooting job with a 5 year old ( due to start school). He would only poo in his nappy and would hold on for DAYS if his parents refused to give him his nappy.
Heres' what we did, and it worked for that family- so maybe worth a try?
Day one-took him to see the doctor, who did an abdominal check to make sure there wasn't anything 'going on' that we didn't know about- although not constipated he prescribed a glucose (i think) syrup to loosen the stools so that we were certain that he wasn't in pain and so he couldn't hold onto his poo for days.
explained to him that from now on, he was only to use the pull up for poo's and would need to wear pants at all other times- then when he needed a poo he would come and get a pull up- but I told him,he was only allowed to poo(in pull up) whilst in the bathroom next to the toilet. To begin with , he didn't volunteer the informaion that he needed a poo- so I sent him with a pull up- off to the toilet at intervals throughout the day.
When he finally began to volunteer the information he needed a poo- and it became second nature- then I told him that if he wanted to poo in a pull up- he would have to be be sitting on the toilet or potty with the pull up on.
after a few day of this being accepted and him sitting on the toilet with the pull up- and when he was comfortable with the situation I then cut a hole in the bottom of the pull up ( sounds odd- I know- but I think he was worried about the poo 'falling' out of him? or something he couldn't articulate- but i thought a total gradual process was the only way as his parents had called me in because they had tried everything else- including creams for his bum so it didn't tear- when he got so constpiated form holding it in)
day by day- i cut the hole bigger and bigger- until he just was wearing the waistband of the pull up- and holding a whole intact unused pullup in his hands for comfort-(sounds wierd) - then he progressed into wearing no pull up, but doing a poo in the potty- onto a pull up in the bottom of the potty.
If you try this, make sure you insist he tries potty and toilet otherwise, you will have to 'wean' him off the potty later on.
Maybe give this a try, if all else has failed.