It helps to understand the different aspects of dimensions, so you can use the terminology correctly. This will help you define your variables in OpenSCAD with correct names. (Tolerance is the wrong term to use.) And once you have correct names, you'll understand how to specify the dimensions in OpenSCAD.
- Tolerance is the amount of random deviation or variation permitted for a given dimension.
- Allowance is a planned difference between a nominal or reference value and an exact value.
- Clearance is the intentional space between two parts.
- Interference is the intentional overlap between two parts.
Two other terms
- Accuracy is the maximum dimensional variation between parts. A machine cannot produce parts with a tighter tolerance than its accuracy.
- Precision is the size of the steps your machine is capable of. It is often confused with accuracy.
In your case you need to define the allowance in order to create the clearance you desire.
To design your 5 mm pin and 5 mm hole, you need to understand your machine's accuracy. The printer could print the pin larger than 5 mm or smaller than 5 mm. Or it could print the hole larger than 5 mm or smaller than 5 mm. You'll need to print some pins and holes and measure the differences between what you defined and what you printed. The difference between the largest and smallest measurements you take is your machine's accuracy. And be sure to check the accuracy in your X, Y, and Z dimensions; your printer might have a difference between them that would impact the roundness of the parts.
Let's say that your printer's measured accuracy is ± 0.2 mm.
Then, we move to clearance. What is the minimum gap between parts you are looking for, and what is the maximum you can accept?
Let's say you want a clearance of at least 0.2 mm between the pin and hole, but no more than 1.0 mm. Since your accuracy is ± 0.2 mm, your pin will be 5.0 ± 0.2 mm, so the hole must therefore be 5.6 mm ± 0.2 mm. The minimum tolerance condition would be an minimum sized hole (5.4 mm) and a maximum sized pin (5.2 mm); the maximum tolerance would be a maximum sized hole (5.8 mm) and a minimum sized pin (4.8 mm).
Note that a clearance of 1.0 mm might be too sloppy for your application. You might think to tighten the tolerances to 0.05 mm in order to reduce the clearance. But if your printer can't produce a part that meets your specified tolerances, you would need to find a different way to manufacture or finish the parts.