Yes, companies can create their own rules and follow their goals. Different companies have different rules for meeting hiring quotas. Based on their personal beliefs and corporate culture, Starbucks is allowed to hire a certain number of refugees if that is their goal. I see nothing illegal about this goal.
There are many groups of people that are subject to special hiring goals. The USPS, for example, focuses on hiring veterans as often as possible, giving them preference over others whenever possible. Some employers target the homeless, some look for those living in poverty. Even women and minorities receive this special hiring treatment in some industries. It happens, and I don't see why it wouldn't be legal.
Yes, companies can legally hire refugees by their status alone. To be a refugee in the United States, you have to qualify as being violently targeted in your home country based on your race, religion, nationality, membership of certain social groups, or political viewpoint. It is already extremely difficult to qualify as a refugee in the first place. It's even more difficult to find a job in a new country and keep it. By hiring refugees, Star Bucks is helping the economy by allowing refugees to work instead of having to apply for welfare (if it's possible for them to do so). I personally don't see any legal complications with such a decision.
There are many people who are searching for jobs, who have lived in their country for their entire lives. I can imagine a feeling of being cheated, when you apply for a job, but you didn't get it because some one else who applied happened to be a refugee. People should be hired based on their merits, and not their background.
When a person applies for a job, the company doesn't know what's going on in the person's life. It's unfair to give any person special treatment based on any status, and that includes military status. Each person should just be hired based on their ability to do the job they want to do.