Olaf is pretty versatile in the sense that, in many cases, he can build tank or damage and still do his job (getting to and killing the enemy carries or keeping them out of the fight long enough that your team can beat their team) effectively.

Tanklaf = 9-21-0
Olafgar = 21-9-0

Tanklaf

In match-ups were you are automatically going to get poked to heck and back you can go 9-21-0 and just build tanky to survive the poke while getting the farm that you can. Ragnarok still lets you get to the enemy team's carries unimpeded by pesky crowd control. Reckless Swing still chunks them for a quarter or more of their health at a time, Tough It Out makes them weep as they realize their autos and other sources of damage are only making you attack faster while you get health back.

Against AP Poke - e.g. Ekko

Rush a Spirit Visage and Mercury's Treads.

After that you can build some damage. If you have two other AD damage sources on your team and your team needs a tank, then Black Cleaver is a good choice. The only downside is that your are likely to go over the CDR cap, so that stat will be wasted.

So a full Tanklaf build against AP poke would look something like

Mercury's Treads
Spirit Visage
Black Cleaver
Frozen Heart
Banshee's Veil
Turbo Chemtank

If there team is largely AP, then you can opt into a Hexdrinker] and then into a Maw of Malmortius instead of the Black Cleaver.

Against AD Poke e.g Quinn or Vayne - Theorycrafting here as I haven't actually done these match-ups.

Ninja Tabi
Randuin's Omen
Black Cleaver
Frozen Heart
Turbo Chemtank
Spirit Visage

You can sub in Thornmail for Frozen Heart if you like.

Olafgar

Teemo - If Teemo is building AP You can can 21-9-0 him, but you'll need the Mercury's Treads and Spirit Visage to deal with his poke. If you ever get near him and he isn't standing on a shroom you can kill him. Big IFs though. If Teemo is rushing Blade of the Ruined King and running attack damage Quints for more of an On-Hit build, the equation may change.

If you are in an Olaf friendly match-up and your team doesn't need a tank you can opt into a more damage oriented build.

Offensive Item Choices:

Youmuu's Ghostblade helps you get to carries and do frightening amounts of damage to them quickly.

Blade of the Ruined King helps you stick to carries, while lifestealing off of them, and chunking them for 8% of their health with every auto attack.

Ravenous Hydra - gives your a large boost in AD, gives you an autoattack reset, and a good amount of lifesteal. Get this if you feel like you need the waveclear so you can get about more important things.

Defensive Item Choices:

Frozen Heart gives you a good chunk of armor, lots of CDR, mana, and slows the attack speed of all enemies in range of its aura. The thing is once you go on their carries, you are very likely going to become a point of focus yourself, so slowing the attack speed of your target and anyone trying to peel for them is very useful.

Turbo Chemtank gives you a large chunk of HP, helps your regeneration rate, and gives you an active that can help you get in range of the carries on the enemy team. Also provides enough mana so that it is no longer an issue allowing you to spam Undertow without going OOM.

Randuin's Omen It is a good item, however with the inclusion of Turbo Chemtank I find myself getting this less frequently on the champions I use. If the enemy team doesn't have much AD or is more reliant on spells than autoattacks for damage then pick up this item.

Thornmail - huge chunk of armor and dishes some damage back to things that autoattack you. Pick it up if you need to deal with a fed ADC.

Guardian Angel - So Olaf likes to murder carries. This in turn often gets Olaf dead when he receives focus fire from the enemy team. However, if you have this you get to come back with a decent chunk of health to hopefully murder more carries. Get this if you are dying before you can do enough damage/cause enough havoc to turn team fights in your team's favor.

Spirit Visage - has good synergy with Vicious Strikes and any lifesteal items that you choose to build. Olaf's go to choice for MR.

Banshee's Veil - also a good item, but doesn't have quite the synergy with Mr. Laf's other abilities. It is really good for messing up champions that rely on chaining their abilities together as it causes one of the links in that chain to fizzle. I pretty much only get it when the enemy team is heavily AP and I need to tank for my team.

Mercury's Treads - you don't have Ragnarok on all the time, so these boots are great for limiting the time you are out of action because of enemy CC. I probably get these in 85% of my games as teams almost always have some form of CC.

Ninja Tabi - I will sometimes get these in AD lane match-ups, especially if I intend to go for a more damage oriented build as these at least give you some armor to shrug off the damage from your lane opponent and minions.

ADC Match-ups

Vayne = if fed, then yuck. Does true damage and has lots of tools to kite you and make you miss Undertow. You have to save Ragnarok for when you are on her and even then she is probably going to save Condemn until after Ragnarok has expired. Build lots of health, attack speed reduction, and Thornmail. Hope someone on your team hits her with hard CC.