While translating a technical document I began thinking about socket and outlet. It seems like they're mostly interchangeable. Is that correct? Or is there a difference between the two?
The other answers are being too specific. A socket is something into which something is plugged or fitted (also called a receptacle). An outlet is something that something comes out of.
A light socket is called a light socket because a light bulb is inserted into it. A power outlet is called an outlet because power comes out of it. It could conceivably be called a power socket but this is not usual and is possibly confusing.
Neither of these examples is intended to imply the power doesn't come out of a light socket or that a plug isn't plugged into a power outlet. Those are facts but not related to the terms in question themselves.
If you are in any doubt that context is not enough, just use light socket and power outlet.
If you're talking about the endpoint of a logical network connection (such as Berkeley sockets), only the term 'socket' is used. These are never called 'outlets'. Only physical endpoints are ever called 'outlets'.