I have two datasets namely GSE72540(patients with moderate and severe chronic spontaneous urticaria) and GSE164805(COVID19 Patients). Both datasets contain 46 GSM(15 and 31). How can I compare samples of both datasets together in one go?
You cannot directly compare completely different and independent datasets. Batch effects will dominate the analysis and there is no way to remove that effect. This has been asked many times before. It's not a meaningful analysis.
Either find a dataset that contains all the experimental groups you need or create the data yourself.