Is it safe to take ferrous sulfate or multivitamins (containing some acid like ascorbic) if you have erosive gastritis and hiatal hernia?

Generally yes. Over the counter vitamins and mineral supplement are generally safe. Gastric acid is necessary, but can become problematic if excessive amounts or ulcers develop. Okay to ask your health care team for advice. Stop using them if your develop symptoms. Be well.