My problem isn't that the pegs are slipping or loose, but that they're stuck. I am afraid I'll break it if I pull too hard. Please help.
First thing: pegs are relatively cheap, even including the cost of getting them fitted by a luthier (which you absolutely must do if replacing a peg). So start, as LP suggests, by trying a little bit of dehumidification (NOT an oven!!) to see if that helps. Then use a wood-jawed clamp or soft-mouth pliers to apply more torque and see if you can twist the peg loose. Make sure your other hand is holding the peg-box so that the torque doesn't transfer to the box -to - neck joint.
Don't bother trying to drill out the peg, because again there's significant risk of damaging the violin itself. Let the luthier work his "magic."
One last thing: don't get creative and try dripping oil or the kinds of solvents used to free up frozen metal screws in machines. Those will damage the violin wood.
If this is a valuable instrument then it's certainly best if you let a professional luthier fix it. They know how to unstick pegs safely and to treat them so they will have just the right amount of friction.
What I personally would do – but have never done with a violin, so take it with a grain of salt – is hammer the peg out from the other side. To do this, rest the violin head sideways on a thin piece of wood, e.g. a ruler sitting on its edge on a stack of books. The violin body is best placed on a pillow. Make sure the ruler doesn't fall over – either span it in an F-clamp, or let somebody else hold the ruler and violin in place while you're aiming on the peg. The ruler should touch the violin head right next to the peg in question. The peg itself should “hang in the air”. Make sure the height of the book-stack is so that the violin neck is horizontal.
Then you need a wood pin to transmit the hammer force onto the peg. One of those pencil-thick ca. 4 cm long ones that are used to stick furniture together would work well, or you can saw off a similar piece from an actual pencil. The lid of a felt-tip could also be usable, but it can't be too soft plastic.
For the blow itself – on my cello I would use an actual rubber hammer, but for violin it's probably better to try it with the handle of a butter knife. Don't be tempted to use something blunter that you can't properly aim with (such as the bottom of a glass or a stone) – it's safest for the violin if the blow is with something light but fast (because that minimises the ratio of momentum to energy).
There are only a few reasons why your pegs would be stuck and feel like they are locked in position. If rosin or peg drops have been applied in an attempt to make the pegs slip less and they have been sitting for a long time the rosin can act like a glue and keep the pegs from moving freely.
If you have a "budget" instrument that has painted pegs rather then hardwood pegs, the paint can bond to the peg box wood, especially when there is extra humidity, heat, or time.
The peg holes or the pegs may also be slightly out of round, causing locking because of the oblong shape.
To free the pegs you need to apply a good amount of force. If you keep the rotation of the peg along the axis of the peg you should be safe from splitting or damaging the peg box. Make sure you don't apply pressure sideways on the peg. Twist and pull in a straight line directly away from the peg box. You can use a sharp yank and pull to break any adhesion the peg may have in the peg holes.
If you can't get a good grip on the pegs, you can use a piece of leather or a thick layer of fabric with a pair of pliers to grab the peg head and apply leverage. Grab the peg and twist and pull outward from the peg box in the loosening direction, usually towards the violin body over the top, but check that your strings are wound the correct direction.
A sharp attack in the loosening direction should free the pegs from the box. If the pegs deform or flex when you attempt this and don't loosen, stop and seek professional repair.
You could try using pencil lead on the stuck pegs. Just scribble a little on the peg as close as you can to where it meets the instrument, and the graphite will help reduce friction. That's what my orchestra teacher always used on the stuck cello pegs, worked like a charm and didn't damage the instrument. Even if this doesn't work to get the peg unstuck, do it before putting the peg back in to prevent the problem from happening again.