For companies, courts generally look at whether or not the company could have expected to defend a suit in that state.
Your facts are a bit confusing, is the out of state defendant in the same state as the plaintiff?
Also, regardless of where the first company is incorporated, does it have branches/agents or does business in the plaintiff's state.
There are a lot of factors a court looks to, but these would be the preliminary questions.
Usually the biggest question is where did the harm occur, and was it foreseeable for the harm to occur there.