The traditional sizing systems are based on a measurement of the outside diameter of a tire. A larger rim goes with a skinnier tire, and vice versa. If the bicycle has hub brakes (drum, disk, coaster), different rim sizes are possible as long as the tire is fits the frame. Nominal tire width is marked on the tire actual width can be measured if the tire is installed on a rim. Measure at the radius of the widest part of the tire, usually the rim radius plus half the tire width -except that the widest part may be at the tread of an off-road tire. The space between the fork blades or stays must be wide enough to clear the tire, with a few mm extra on each side in case the wheel goes slightly out of true.
On a bicycle with horizontal dropouts, additional clearance to the chainstay bridge is desirable so the wheel can be removed without deflating the tire. A tire must have typically 1 cm clearance, 2 cm if a fender will be installed, but do not use a wheel that is much smaller, or a pedal is too likely to strike the ground in cornering. Tire outside radius is nominally the rim radius plus the tire width, and as much as 1 cm greater for a tire with a deep tread. Take measurements from the axle position to the fork crown, chainstay bridge and seatstay bridge. The front tire must not reach the fork crown the rear tire must not reach the seatstay bridge or chainstay bridge. A different rim size may be possible with different brakes, though longer brake reach generally results in poorer brake performance.
Then look up the rim radius in the ISO table on this page. So, first measure the distance from where the center of the hub axle would be in a dropout to the center of a brake shoe. If the bicycle has rim brakes, the rim must line up with the brake shoes and so only one rim size or a small range of sizes will work. To determine which tire size will fit, perform measurements on the bicycle's fork and frame.