Is it better to have a flat wall for the speakers (with the tv slightly forward of the wall), or will it be fine to recess the tv and have the mains forward?
Home cinema in-walls can do two things for you: aesthetically, they make for a neat, unobtrusive installation; and acoustically, they can benefit from being set into what is effectively an infinite extension of their own front baffles. Below their beaming frequency, imagine acoustic waveforms crawling laterally across the wall, just waiting to find a place to fall off and cause edge diffraction effects.
A recess for the screen will allow such an edge. A counsel of perfection would be to make trim pieces, so that the screen is seamlessly in the wall plane, with no gaps. Second best would be to mount the screen slightly forward, so the baffle extension continues behind it.
But ... there are no "mains" (plural) in HT. L & R are supplementary channels, albeit important. The "main" (singular) is the center channel. All the narrative information is there, i.e. virtually all the dialog and most of the music and important effects. So the #1 priority is to get the best C you can, and mount it where it can be heard most directly.
All of which says it won't make a huge amount of practical difference whether the screen is recessed or standing proud. The edge you're creating would be much less than 360 degrees around the speaker. I would say go ahead and make the recess. The aesthetic effect will probably give you more pleasure than the small acoustic disadvantage would subtract.