Is a person allowed to take 20hrs flight while 37 weekspregnant?

Pushing the envelope. Nulliparous females go 49 weeks or longer. Women with several pregnancies usually are less. I think is a less than ideal situation! since you are traveling so far, where will you be. Medical care? Insurance? How long a stay? And the flight back? You should have answers before going!
Probably not. In general this is probably not a good idea, but you should discuss this and the details of your circumstances with your OB physician.