Is this an exterior or interior door?
If it's exterior, I'd recommend going with new so you get a good weather seal.
For an interior door, if you can find a good quality used door in a style you like, I don't see a significant disadvantage to getting a used one other than the trouble of making sure it's mounted correctly on the hinges. If the door frame is included, you'll want to be sure the depth is the same and that it hasn't been cut too short for your flooring.
First things first: Check to make sure the screws in the hinges are all tight. If they are not, you can pack the screw holes with toothpicks and white glue, and once dry, redrill and reset the screws.
Next things next: Assuming that the hinges of the doors are properly mortised (set into the wood), that the door has not sagged on its hinges (a different question), and that there is no significant bump in the frame, the best bet is probably to trim down the doors and then properly seal them to prevent moisture absorption.
There is supposed to be a gap between the door and the jamb (the broad moldings that face toward the door opening). This gap should be about the thickness of a nickel (but a good bit larger at the bottom) when the door and framing is at its tightest (in high humidity). Doors and their frames shrink and expand naturally, and sealing (with paint/varnish/poly/etc.) is meant to minimize, but not eliminate this shifting. Once you have a sticking point (assuming the hinges haven't shifted much) you need to re-size the door.
Sanding may be sufficent, but you probably need to take off at least 1/16th and preferably 1/8 to solve the problem long term. In most cases it is worth taking the door down so that you can work flat and exert some pressure. Befor taking it down, mark the tight spots with a pencil line run parallel to, and about 1/8 in from the jamb. Then pull the hinge pins and set the door standing on its hinge edge down. If you need to work near the lockset, you may need to pull the latch bolt and its faceplate, or the whole lockset if it is a mortise lock. Either way, you need to remove the door handles and the spindle.
An orbital finish sander may do it, but this may be too slow. Careful use of a belt sander may be preferable. But careful. A plane or Sureform-like tool can remove a fair amount of stock without much risk of serious gouging.
Check the door regularly by resetting it on its hinges. Be generous with your trimming. It is hard to over-trim and you don't want to be doing this again.
Last things last: Once you are certain of the fit, take the door down again and SEAL IT! Prime and paint all expose wood, or stain and topcoat if using clear finish. Let it fully dry. While it is down, check to make sure that both top and bottom of the door are sealed. This is often the most frequent source of the moisture that causes door to swell.
P.S. I learned these lessons the hard way, having installed several doors on a basement project (read soon to be damp) in winter where the gapping was not quite sufficient and the sealing was less than complete.
Best Answer
Quite simply, you get doors of nonstandard size via special order.
When looking at door replacement, measure the size of the door slab itself, not the frame. If you have e.g. a 30 inch door, that means the rectangular piece of wood that is the door itself is 30 inches wide (and likely 80 inches tall which has been standard in the USA for decades, although that can vary as well). A 30 inch door may require a 30.5 inch gap measured from edge to edge of the frame (note: this is an example, I don't know the actual clearance). If you try installing a 30.5" door slab into a frame with exactly 30.5" of clearance, you will not be able to close it. Doors have thickness, and the hinges need a little bit of wiggle room as they swing the door out.
Your question is slightly ambiguous about what exactly you are trying to replace, so I will cover both options here.
Replacing the door slabs: simply measure the doors themselves. Measure the width, height, thickness, the dimensions and locations of the hinge plates, location of the latch (the part that sticks out of the side and keeps it closed), etc.
Replacing the door along with the jamb, i.e. a complete pre-hung door. Measure the width and height of the door slab, and also the rough-in size. Do this by removing the door casing carefully to avoid damaging the surrounding area, and removing any other obstructions that prevent viewing the underlying wall framing. You should be able to see the edge of the drywall and, depending on how tight the jamb is to the wall framing, the jack studs that surround the door. Measure the width and height of the rough-in opening. I would also measure the thickness of the wall: while a 2x4 wall is fairly standard, you may encounter "sideways stud" walls that are thinner, or even a 2x3 wall. This could be the case in older construction near closet doors (my house has a few like this).
When you talk to the person helping place the special order, it helps to have all of these measurements already done. "Hi, I have a door slab with dimensions X by Y, rough-in is A by B. I need a pre-hung door that will fit in this opening."
Do not underestimate the importance of measuring all of these things instead of going to the nearest big-box home improvement store and grabbing a door off the shelf that may or may not fit. Even little things like making sure the mortises for the hinge plates match (if buying only the door slab) will save you time and frustration later on.