Yes, if there is space behind the socket for the shelly to fit. Just make to kill the power and verify before touching.
Here is link to a wiring diagram for a switch. [SOLVED] Shelly1 - Inside Light π‘ fixture - #11 by H102
This one will be more for what your doing with a socket as there is no switch. [SOLVED] Shelly1 - Inside Light π‘ fixture - #17 by H102
Let me know if you need further explanation on how to connect the wires. Also I would use an extension cord to power the Shelly near the location to verify it has a good wifi connection (make sure itβs not out of range before going thru the install hassle).