Interior handrails can be treated in a number of ways. If you're trying to match the colour to the floor or stair treads, staining the wood with a wood stain is usually the best course of action and then sealing with a wood wax, wood oil or varnish, if necessary.
Exterior handrails are a similar story, using an exterior coloured woodstain such as Sadolin Classic Wood Protection or Osmo Natural Oil Woodstain will not only colour the wood to match or contrast any surround wood but will offer protection from the elements and the inevitable finger marks.