In this paper we present a method for determining whether there exists a largest Orlicz space L^A(Ω) satisfying the Sobolev embedding W^m L^A(Ω) RIGHTWARDS ARROW Y(Ω) where Y(Ω) stands for an arbitrary so-called Marcinkiewicz endpoint space. The tool developed in this work enables us to investigate the optimality of Orlicz domain spaces in Sobolev embeddings and also in Sobolev trace embeddings on domains Ω in R^n with various regularity.