Absolutely totally 10000% not! Playing with mains if you need to even ask questions like this (and often even if you don't) is the swiftest way to electrocute yourself. Please don't do that!
The safest way to control mains appliances is to use a remote controlled socket such as the Energenie Pi-mote: https://shop.pimoroni.com/products/pi-mote-control-starter-kit-with-2-sockets
Or hack the remote/protocol of any off-the-shelf remote control sockets- with the remote being IR or RF and totally air-gapped from any unsafe voltages, it's safe to tinker with.