We frequently use extension cords to carry an electric current to a place that is far from an electrical socket.
Joining wires in an uncontrolled way is usually not a good idea. Any household should have prepared extension cords. If you are going to buy and extension cord to carry a current from a socket to some tool (or some other gadget) you should know this: