Can my H1B be transferred before stamping?

I have a valid H1B petition and stamping is yet to be done. Currently I am in India. Can I get my H1B transferred and get the stamping done while in India? Will my visa be valid if I shift my job at this stage?

Yes, you can do H1 transfer