If the seal is being fitted to original equipment you may have some influence over the shaft and housing bore finish, but if you are replacing a worn seal you still need to take into account the condition of these 2 essential parts.
The other way oil seals work is by stopping outboard materials that can damage the machine or contaminate its lubricant. The outboard materials that the oil seal will need to stop depend on the application. However, the most common kinds are dirt, moisture, and the particles produced during manufacturing.