Foam rollers and massage guns are both recovery tools, but they apply input in very different ways. A foam roller uses bodyweight against a broad cylinder or shaped surface. A massage gun uses a powered head that pulses into a smaller area with adjustable speed and amplitude.
That difference changes pressure control, setup, sensation, portability, noise, battery needs, and how precisely the user can target an area. Neither tool should be treated as a treatment guarantee. The useful comparison is how each delivers pressure and how that delivery fits the user's routine.