In each of the 21 states, it is legal not to hire people who use nicotine, company officials said. Employers in 17 states are also legally allowed to test for nicotine, officials said.