H1B transfer

Say I have filed H1B petition with the company A and it is picked in the lottery got approval

I can now initiate transfer with the company B and travel ? is this legal ?

please comment