This action that Megumi is doing signifies anxiety and stress. It is a nervous habit, as explained in the show and manga. From the wiki:
She has a habit of tracing the kanji for "person" (人) on her hand then motioning, as if to eat it, whenever she is stressed.
I'm not familiar with the culture of Japan on this matter, but according to this article on the University of Southern California's site, it is part of the culture. Here's a quote:
In Japan, students nervous for a presentation are often told to draw the Chinese character for “person,” 「人」three times on their hand. They are then supposed to pretend to eat those “people” by putting their hand in front of their mouth, in the belief that this will ease their anxiety.
Furthermore, according to the same article, the rationale is:
The idea was that those three 「人」characters represented the audience in the palm of her hand, and eating them made them seem irrelevant, undeserving of her anxiety
I'm not familiar with Minoru Mineta doing this, but if it's really the same action, then everything still applies. And I'm fairly certain I've seen similar things done in other manga and anime, but I'm drawing a blank right now. I'll update if I remember any.