Background and PostProduction techniques

Hello,

Have you got any suggests or tutorial resources explaining how to put correctly in a 3d scene a “real” background from some photos? I mean both outdoor and indoor through a window for example!

Is better to achieve it in PostProduction or directly in Max?

Cheers,

Giulio