Can heartburn cause nervousness?

Well..it may cause.. For example: heartburn can be perceived as a possible heart attack and thus can cause the person to be nervous/anxious/scared, but this just means it can trigger those symptoms, not causing the anxiety disorder itself. Having underlying anxiety disorder and having certain illnesses can make the anxiety worse over time. If severe/persistent, you can develop anxiety/depressive disorder. Consult doc.
Related. Emotional distress including nervousness is frequently associated with physical distress & vice versa. Persistence of one can lead to difficulties managing the other. In regards to the question, a sensation of "heartburn" can be experienced as nervousness depending on how the individual perceives it. Discussing concerns with a provider can assist with determining cause(s) & possible treatment(s).
Heartburn. Yes it can especially if the cause is not yet determined.