It is not illegal to attend the interview
You can change to company B without leaving the country.
You are welcome to contact me via link provided if you would like legal presentation.
Congratulations upon having two employers wishing to employ you. In general, a person who enters the U.S. an an intracompany transferee visa (L-1) with the intention of working for that company, and who later explores other employment opportunities, may indeed become hired by another company. While remaining in valid L-1 status, the employee may become the subject of a new H-1B visa, and may complete this "change of status" within the U.S.
[Note: Consistent with Avvo policy, this communication is intended as general information and not specific legal advice, and this communication does not create an attorney-client relationship.]
David N. Soloway
Frazier, Soloway & Poorak, P.C.
1800 Century Place, Suite 100
Atlanta, Georgia 30345 www.fspklaw.com
404-320-7000 * 1-877-232-5352 * email@example.com