This is a big question. There’s a different answer for every customizer, and for every figure. As the mechanics of almost every figure is different from another, there is no single method.
Lately I’ve switched to using magnets for swivel joints. They’re relatively easy to use, and frankly, they’re fun! I’ll drill shallow holes in either side of a joint and fill with rare-earth magnets. So much easier than making new pegs!
Swapping ball-and-socket arms at the shoulder is tough. I try to avoid it, if possible. (I’ll often swap arms just below the should, either by building a new swivel joint there are just gluing the new part in place.) If you must remove an existing arm at the shoulder, I would start by heating up the area with a hair dryer. I’ve popped out a few Marvel Legends and Bombshells arms that way. But that’s fairly hit or miss. Many customizers will “crack the torso.” Yes, that will give you access to the arms, but whoo-boy, that can create more problems than it solves. Have fun putting that back together and patching all the damage.
I recently had success swapping an arm at the shoulder with a different method. I yanked the existing arm out as much as possible. The joint itself would not come loose, so I drilled into it until there wasn’t much left and it just fell apart. Now I had a torso with a hole in the shoulder, and a new arm with a shoulder peg. I filled the hole on the torso with epoxy, then gently pushed the arm with the peg into the epoxy, and then I let it sit while the epoxy cured. Once solid, the epoxy formed a new socket around the peg. It operates as well as any manufactured piece. (The piece in question is this Joker.)