I cannot say for sure because I have not made a "cornstarch pudding", so I have no basis for comparison.
What I can tell you is that the pastry cream I have used for decades is thickened with egg yolks and flour. Whole milk/cream, sugar and flavoring (pure vanilla extract or vanilla beans, or melted chocolate, or grated lemon zest) are among the other pastry cream ingredients. The pastry cream is cooked over a double boiler, stirring constantly until the mixture comes to a boil. It is then boiled for about 4-5 minutes. It is then cooled/chilled for about 4 hours until it is very thick. (Pastry cream should be thick enough to be piped through a pastry bag and hold its shape.)
If that is how "cornstarch pudding" is made, then I suppose they are interchangeable.
I am not sure how long a "cornstarch pudding" will hold up before it starts to weep, or if it is thick enough to hold its shape when piped.
