Yes, there are such images. One of the
properties of opening (it's mentioned in wiki article, for example) is
that it is an anti-extensive operation, i.e. if Y
is opening of X, then Y ⊆ X. Similarly, closing
is an extensive operation (i.e. X ⊆ Y),
therefore for any such image X = Y. Any image
invariant to both opening and closing will satisfy
your requirement (and, as I have just shown,
only such images will).
Concrete examples depend on structuring element
used when performing erosion or dilation. For
example, if it is a square n x n matrix with all
elements equal to 1, then any rectangle with both
height and width greater than n (and located far
enough, i.e. at least n/2 pixels, from image
edges) will satisfy this requirement.