Somewhere in the instructions that came with the valve they'll have a diagram showing min/max on the valve. Often, the valve will have a mudguard (plastic piece) that attaches to the valve with marks on it. Those marks indicate where the finished wall must be for the trim to fit. If you read some and search, you'll see many people do not like the look of the valve when it is sticking out to the max. The only way you'll know if the valve is positioned properly in/out of the wall is by mocking up your intended wall construction and I suggest you temporarily install the trim to see how YOU like it, and then adjust as necessary to get the depth proper. Having it too far out, and you'll not be able to tighten the trim down. Too far in, and you may not be able to attach the trim at all (some have an optional 'deep wall' kit extender, but that may just push it out further than you want...so, careful measurement is called for).
As to the hot pipe's heat damaging the tub...no it should not, but as things heat up and cool off, if it is rubbing, it could make some noises. Rubbing on a hard surface long-term is not a good idea.