Trademarks are usually registered in one or several international classes (there are 45 of them), but there's a cost per class, so most companies don't try to cover the whole spectrum:
So, you can have a "Widgets" trademark for class 9 (Electrical and scientific apparatus), and another company can own the "Widgets" trademark for class 29 (Toys and sporting goods).
Some companies do register their trademark across the whole spectrum, like Coca-Cola, and probably Nike too.
Note that pharmaceuticals are a whole different story, as there are so many of them that you can have similar-sounding ones as long as they do something very different.
http://www.uspto.gov/trademarks/notices/international.jsp
So, you can have a "Widgets" trademark for class 9 (Electrical and scientific apparatus), and another company can own the "Widgets" trademark for class 29 (Toys and sporting goods).
Some companies do register their trademark across the whole spectrum, like Coca-Cola, and probably Nike too.
Note that pharmaceuticals are a whole different story, as there are so many of them that you can have similar-sounding ones as long as they do something very different.