You can opt for either a tourist visa (valid for 60 days) or a Non-O dependent visa (valid for 90 days) in Dubai. In Thailand, you can then convert it to a marriage visa (with an additional year of validity). However, please note that you'll need to check with the embassy as they require certain documents such as a marriage certificate and proof of funds in the bank. Dont forget to get Multi entry stamp before exiting Thailand, without the stamp, even though your visa is 90 days, if you exit on day 60th and would like to re-enter before day 90th, you would need to get another visa.
I presume your wife wants to deliver the baby in Thailand due to her desire to be close to her family for support, as delivering and caring for a baby is new to her. Perhaps you could consider delivering the baby in Dubai instead and fly your wife's family members or parents to Dubai?
We delivered our daughter in France and are now residing in Thailand. When we share stories about our daughter's birth, such as during school registration, participation in activities, or applying for visas, we've found that immigration officers and Thais are more accommodating towards us and our daughter. Moreover, this experience could potentially foster a desire for your child to learn a new languages and explore new cultures.