I have a rather simple photo, with two buildings and one target.
I know the bearings of the two buildings from the observer $(\theta_1, \theta_2)$, thus the angle between the two buildings are known ($\theta = \theta_2-\theta_1$). I can measure the "distance" between the two buildings in the photo ($D$, in pixel), and the "distance" between the target and building 1 ($d$).
Does the bearing of the target can be calculated as simple as $\theta_1 + (\theta \cdot \dfrac{d}{D})$ ?
It’s not quite that simple since angle isn’t a linear function of visual horizontal displacement: the closer you are to dead center, the faster the angle changes. I’m sure you’ve seen this effect yourself when watching moving objects whiz past. However, it’s not terribly complicated, either.
Assuming the usual pinhole projective camera model, the overhead view of the scene is something like this:
The vertical broken line represents the image plane at some as-yet-unknown distance $f$ from the observer $O$ and the dotted line is the view axis, which serves as the reference for the bearing angles. So, $$\theta_1 = m\angle{FOA}=m\angle{FOA'}$$ and $A'F = f\tan\theta_1$. Similarly, $FB'=f\tan\theta_2$ and $D=A'B'=f(\tan\theta_1-\tan\theta_2)$, therefore $$f={D\over\tan\theta_1-\tan\theta_2}.$$ A similar calculation for $\theta$ gives $$d = A'C' = f(\tan\theta_1-\tan\theta) = {\tan\theta-\tan\theta_1 \over \tan\theta_2-\tan\theta_1}D$$ and solving for $\tan\theta$ results in $$\tan\theta = \tan\theta_1+\frac dD(\tan\theta_2-\tan\theta_1).$$ Comparing this to your original attempt, we can see that there’s a simple linear relationship between the tangents of the angles instead of the angles themselves. For small (measured in radians) angles you can use the approximation $\tan\alpha\approx\alpha$, in which case your equation would be approximately correct.