Sure. Companies often invest in other companies. Google Ventures is an example of this. Microsoft invested in Facebook then promptly integrated connect into Bing, Xbox Live and Outlook.com (with probably more to come).
Starbucks can benefit from the Square deal, invest in them, and help promote them all at the same time. Actually pretty brilliant.
Quick clarification on Google Ventures: Microsoft in Facebook or Starbuck in Square are those companies acting as "strategic" investors. Google Ventures is different in that it's a venture investor: it tries to be completely separate from Google proper and doesn't necessarily come with any close business relationship between the investments and Google. People can argue over whether it can actually achieve this separation, but it's run in a completely different way from ordinary corporate VC (which is usually managed by business development inside the parent company).
Starbucks can benefit from the Square deal, invest in them, and help promote them all at the same time. Actually pretty brilliant.