Electrically, yes. Whether it is safe or not will depend on the type of junction box, and your wiring competence!Is it safe to wire both together using a junction box?
some of those in line switches are borderline dangerous with the conductors just held by bent bits of metal rather than proper screw or wago type terminalsPresumably, they come with plugs to insert into sockets.
Why not just use a "Power Strip"'
such as one of these
https://www.amazon.co.uk/s?k=power+strip&crid=D0AEI17GUV8&sprefix=power+strip,aps,352&ref=nb_sb_noss_1
some of which come with switches?
Then, if you need a switch in each "cord" near to the lamp itself,
install an "In-Line" switch in each "cord" -
such as one of these
Nowhere doesThose lamps might come with a sealed in line switch so no chance of adding another cable unless of course the op is adding his own switches.
Incorrect.I’m sure I’ve wired two lamps into one plug in the past - as long as the wires are thin enough it shouldn’t be a problem.
Why do you dispute that Mottie has wired 2 cables to a plug?Incorrect.
Well, it worked for me. Also, at my old workshop, I had an outside socket. So that it wasn’t permanently on for others to possibly use, I connected it to another socket on the inside using a piece of 2.5 twin and earth cable. Again, it worked for me.Incorrect.
How can he possibly be incorrect in telling us what he has done?Incorrect.
For what it's worth, I would personally say that there would be no significant problem IF the two cables could be terminated and accommodated satisfactorily. ... and, yes, I've been known to do it myselfWhilst it might seem a bit off at first thought, assuming everything was done correctly what really would be the problem with having two cables in one plug?
If you need to find a tradesperson to get your job done, please try our local search below, or if you are doing it yourself you can find suppliers local to you.
Select the supplier or trade you require, enter your location to begin your search.
Are you a trade or supplier? You can create your listing free at DIYnot Local