File joint h1b tax return with spouse on b2 (visitor) visa?

I am on h1b visa and will be staying in the US on this status for the full year. My girlfriend and I are planning to get married here in the US considering travel restrictions. She will come to the US this year for 2 weeks on B2 visa and then leave after that. We are not planning to apply for H4 COS for her this year.

 

Can we file 1040 jointly for the year considering I will be on h1b for the full year and she will be in the US on B2 visa for 2 weeks?

 

If yes, would there be any issues getting ITIN for her while filing w7 with the 1040 considering she won’t be in the US while filing the return? Or should we get the ITIN before filing the tax return?

 

Please also advice if there is anything else we should consider to file a joint return to make the process smoother. Thank you.

 

Note: I know that we can make a choice to consider non-resident alien spouse of a resident alien as resident alien for taxes and file a joint return. For the complexity of my specific scenario, I would like to confirm if is it possible or not.