It depends whether it is set in a plastered brick or blockwork wall, or is in plasterboard.
Sockets should always be fitted in a fireproof enclosure. In a plastered wall it is a rectangular metal box, screwed to the wall, and in plasterboard it is a plastic box that has clips to grip the board. The metal box is plastered round level with the wall. The plaster is outside the box so is away from the electrical parts. The plastic box is supposed to be fitted into an accurately cut hole so should need no filler.
In both cases, the box is smaller that the fascia of the socket so it hides the join.
To repair it properly you will need to turn off the power at the consumer unit and test for dead before slackening or removing the two fixing screws in the plastic fascia plate to give you access.
A few things:
The wires going into the socket are retained by screws in brass terminals. If they are badly fitted, too short, or loose, they might come out. You can put them back and tighten the screws but you will need the correct size of screwdrivers, and possibly a torch. Electrician's screwdrivers are insulated for safety, usually in red and yellow, and sold in sets as "VDE screwdrivers." You can get a decent set at Aldi, Screwfix or B&Q. I think it is important to have the correct tools at hand before you start work in case they are needed.
You will be working with wet filler and possibly metal knives so it is important to cut off the electricity and loosen the socket so you can see what you're doing.
Otherwise, I suppose you could use decorators caulk as a bodge.