It depends on a lot of different things.
Nike, for instance, is an unusual and creative name and, as such, it is a trademark that is considered "inherently distinctive" - for either a fast food restaurant or for a shoe company. Inherently distinctive marks are afforded the most protection of any mark under trademark law. Because the name is inherently distinctive, two companies, no matter how different they are, would usually not both be allowed to register this name (if they somehow coincidentally made up the same name or one "stole" the name from the other). And then, the general rule with trademark law would be that the business that used the mark first could be able to prevent others from using it.
If Nike Fast Food used the name first and registered it, Nike shoes would have a tough time in court if they tried to stop the use - what they would probably do is try to purchase the name from Nike Fast Foods or work out some agreement with the restaurant so they could continue to use the name that they made famous. But, because there is not likely to be consumer confusion anyway, both could potentially be able to use the name, unless the fast food place decided the shoe company's use of its unique name was infringement.
A better example than Nike would be, perhaps, McDonald's. When a business uses a last name as an identifier, the name receives the least trademark protection under federal and state laws. With many people named McDonald, many companies could use this name to identify their hardware store or pet store or whatever. No problem, generally.
However, although trademark law primarily tries to make sure that trademarks do not cause consumer confusion, because McDonald's is now famous and the name has now become synonymous with fast food, courts are more apt to prevent other uses of the name, under anti-dilution laws, that tarnish the name, or that "trade" on the reputation of the name. You would probably be stopped from opening a McPastry shop or even a McFurniture shop. And you would definitely risk an infringement suit if you tried to open any sort of Mc-fast food restaurant, even if your real name is McDonald. The McDonald's fast food chain, however, would not be able to stop a hardware store from using the name McDonald's Hardware.