I’m assuming that your question is referring to straight jack plugs in comparison to right angled plugs.
The short answer is it probably won't damage anything if it's a well made cable. With a right angle plug, it's probably harder to accidentally pull it out, but there are limitations to thier use.
The long answer is below:
I can only speak from my own experience of using various cables over the years with both straight and right angle plugs. A properly made guitar cable is relatively robust and the average jack socket doesn't hold the plug in a vice-like grip. You would probably need to to apply a significant amount of force to damage or break the solder holding the cable to the plug. Many cables and/or plugs also incorporate some form of strain relief to limit the shearing effect of sideways motion (in the picture it's the yellow rubber sleeve projecting from the plug).
I've accidentally trodden on my cable, or snagged it on something, and pulled it out of the guitar a fair few times and it's never damaged the plug or the integrity of the cable.
The best way to avoid accidental disconnection like that is to loop the cable through your guitar strap before plugging it into the guitar, which gives you a bit of slack. It, however, also goes without saying that when you are deliberately unplugging the cable from your guitar/amp/pedal etc. you should never, ever, do so by pulling on the cable itself. Always grip the plug body when you take it out.
Right angle plugs are more difficult to accidentally disconnect because the force is being applied at 90 degrees to the barrel of the plug. However, they don't always fit properly in the recessed jack sockets found on some guitars.
I couldn't get the plug to stay in the socket in the top picture and the second picture speaks for itself.
That said, they're very good for instruments with end pin jack sockets.
At the end of the day it's more a matter of personal preference and what works best for the particular application.
Edit: It occurs to me that cables with a right angle plug would also be a more appropriate solution on guitars which have the jack socket mounted on the front face of the instrument. The Gibson SG and various semi-solid guitars such as the Gibson ES 335 and all its various derivatives/imitators spring to mind.





