There are some cases such as Rope Trick, that have explict language to block this. Gate and Portable Hole have no such language.
There is this answer, but it is for D&D 3.5. In this Q&A multiple answers argue that casting into a portable hole is not the same as casting through a gate in general. This one, argues gates are much more varied in nature than a simple portable hole opening, and this one even argues that extradimensional spaces are different from planes to begin with.
This may mean the answer is only "we can't say in general, ask your DM", but clearly the answer is not simply "look how it works for a portable hole", as in this answer.