Is there a connection between megaloblastic anemia and nutrition?

Maybe. The common causes of megaloblastic anemia are vitamin B12 deficiency and Folic Acid deficiency. A diet poor in these vitamins may lead to megaloblastic anemia.
Megaloblastic anemia. There are several major known causes of megaloblastic anemia some of which are nutritional. B12 and folate (folic acid) deficiencies can cause this specific type of anemia. Alchoholic liver disease can also result in this form of anemia.