Yeah. Headphones will introduce their own issues like a lack of cross-talk between ears, absence of body feel for the low end, and a skewed frequency curve, but yeah they do remove the room from the equation. Your perception of the record won't change when you turn your head or step back two feet. They've got that going for them.
I should stress that most casual listeners probably don't need to fret about this stuff unless they're really committed to the experience. My work studio may be well-optimized, but when I listen to music in my living room there is zero room treatment and it doesn't get in the way of a pleasurable listening experience.
For even like, $500 you can have an absolutely kicking sound system. There’s no way that you’re going to get the range of big ass speakers in small headphones, but regardless this is kind of apples to oranges.