It's probably rare that moons have atmospheres to begin with. Planets don't generate solar flares. Planets emit thermal radiation as a result of their heat and during formation and collision planets can get significantly hot. Earth is believed to have glowed red hot following the theoretical giant impact and that heat actually may have helped give the Moon its lopsided crust. See the Earthshine part of this article. The Moon, which also likely glowed red hot after it formed, was unlikely to have ever had an atmosphere, but in theory, a hot planet could thermally strip a nearby moon if that moon had an atmosphere.
A planet with a surface temperature of a couple thousand degrees could heat the near side of its moon more than the star that they both orbit, perhaps giving off enough heat to cause the loss of the moon's atmosphere through thermal or Jeans escape which is basically a product of upper atmospheric temperature and escape velocity. It might not even be that uncommon for moons to receive more heat from the planets they orbits than the star they both orbit when the planet is undergoing sufficient bomboardment.
A second way that a planet might strip a moon's atmosphere is if the moon was close to the planet's Roche limit. The atmosphere is less gravitationally bound and even if the moon comfortably holds itself together outside the Roche limit, its atmosphere would extend miles above its surface and be less gravitationally bound where gradual atmospheric stripping would be possible.
Moons rarely have atmospheres to begin with, but ice moons at the right temperature can generate atmospheres through outgassing. Pluto, for example, has a tenuous atmosphere from the thawing of frozen nitrogen and other ices on its surface and Pluto's low gravity means this atmosphere is very dispersed and it can extend quite far from the planet, far enough that Pluto and its moon Charon may exchange atmosphere (grain of salt warning with that article, to say they share an atmosphere is an interpretation that I'm not 100% comfortable with, but the article does make the point that an atmosphere can be tenuously held by a comparatively low gravity object like Pluto, and as a result, affected and even shared with a nearby object in a close orbit).
A third theoretical way a planet could strip a moon of its atmosphere would be through magnetism. Jupiter's enormous magnetic field generates a radiation belt that extends beyond its inner moons, certainly beyond the inner 3 of its 4 Galilean moons. The high temperature of the charged particles in a planet's radiation belt could strip a moon of its atmosphere in a similar way that the solar wind can strip planets of theirs.
You just asked about gravity and I gave you three possible scenarios; radiation belts and thermal radiation aren't gravity but they could theoretically strip a moon of its atmosphere. The Roche limit scenario is essentially driven by gravity, so the answer is yes, it's possible. It's not actually the gravity but the tidal forces, which is a product of the gravity that can strip the atmosphere of a moon close to its planet's roche limit.
Moons with atmospheres are probably pretty rare and moons that orbit close to their planet's Roche limits are also fairly rare. So it might be a rare scenario where the two situations coincide.