There is no rule that a pronoun can only refer to a noun in subject position. A classic example of antecedent flexibility that I have seen is the following:
1) We gave the bananas to the monkeys because they were hungry.
2) We gave the bananas to the monkeys because they were ripe.
In (1), the "they" refers to the monkeys; in (2), it refers to the bananas. Both are grammatical, and both involve an antecedent in object position. This example illustrates the point that in some cases the antecedent is clear only from our background knowledge, not from word order. You could also say:
3) The students gave the bananas to the monkeys because they felt sorry for them.
Here, the "they" does refer to the subject (and the "them" refers to an object; again, because of our background knowledge, we would assume that the students felt sorry for the monkeys and not for the bananas). Of course, it can also be ambiguous, as in:
4) The students gave the bananas to the monkeys when they were ready.
In (4), we would need broader context to determine whether the bananas, the monkeys, or the students were the ones who were ready.
For more discussion of anaphora, see http://en.wikipedia.org/wiki/Anaphora_(linguistics)