For sure, (almost) everything is possible if you program it by yourself. However if you expect an on the shelf solution from OpenCV it doesn't exist...
What you are talking about is called : pose-estimation
Depending on the context of your problem, it can be very difficult to do (depending on your computer sciences skills as well)
Instead of a very very long explanation, I think the best is to look at this :
You should try to look at what the field of virtual/augmented reality is, i think it could answer some of your questions... I don't have better answers as your question is very very wide.
Moreover a last tip would be to look at features detection and extraction as a lot of these techniques rely on a good detection of keypoints (to then replace a 2D-3D model into the scene)
Julien,