Yes, a magnetic field can exist without a gravitational field. Magnetic fields and gravitational fields are distinct phenomena that arise from different fundamental forces in nature.
A magnetic field is generated by the movement of electric charges. When electric charges are in motion, they create a magnetic field around them. This magnetic field interacts with other charges and magnetic objects, exerting forces on them.
On the other hand, a gravitational field is associated with mass. Any object with mass generates a gravitational field, which is responsible for the attraction of other objects with mass.
So, it is possible to have situations where there is a magnetic field present without any significant gravitational field. For example, in a laboratory setting, scientists can create and manipulate magnetic fields using electric currents or magnets, without any significant influence from gravity.
In the broader context of the universe, magnetic fields are observed in various astrophysical objects such as stars, galaxies, and even interstellar and intergalactic space. These magnetic fields exist independently of the gravitational fields present in those regions.