When we talk about borrowing chords, we are typically talking about borrowing from another mode that has the same tonic, not just any another key. So if I'm in C major, the chords I'm borrowing are probably from C minor: using F minor (iv) instead of F major (IV), for instance.
However, any chord in C major can also become a sort of temporary tonic, and bring with it chords from its own key. This is often what's happening when you see a D major chord in C major: G (V in C major) is being temporarily tonicized, and so the D major chord is acting as a V chord in the key of G. We give that chord the Roman numeral V/V (five of five). But a chord like that is usually called an applied dominant or a secondary dominant. The term "borrowed chord" is reserved for situations such as the one I described in the 1st paragraph.
Hope that helps!