Let's reduce the code duplication by using function pointers and if's.

1. First of all, IPPDilateReplicate and IPPErodeReplicate look same except for the dilate/erode calls. Let's make a single function that takes erode/dilate parameter and use it inside the switch.
2. Secondly, let's use the 2 function pointers and set the first one to one of ippiMorphologyInitAlloc_*, depending on the type and second one to the processing function. The further logic can be executed after the switch.
3. Temporary buffer should be made cv::Mat:
<pre>
const Mat* _src = &src;
Mat temp;
if( src.data == dst.data )
{
    src.copyTo(temp);
    _src = &temp;
}
</pre>
it's much easier and the memory is managed automatically.