I have a hiatus hernia it has been very painful. Could this problem be due to stress?

Not due to, worse by. Hiatus hernia is a bit of stomach bulging into the chest through space (hiatus) in the diaphragm; can be small or large; may have no symptoms (pain, reflux) or plenty. Worsened by overweight. Symptoms worsened by large meals, acidy foods, alcohol, chocolate, tobacco, lying down after eating, bending over, tight clothes, coffee. Stress won't cause, may worsen symptoms (if it affects lifestyle.
No. Hiatal hernias are not caused by stress but can cause acid reflux as can stress. Acid reflux causes stomach pains. Pepcid (famotidine) or meds such as Prilosec can help. If no help after few weeks would recommend upper endoscopy.