For Olaf and Udyr which role do they fit better in? A jungler or solo top?
Aceofgods is correct, both champions are very strong and can excel in the jungle or top lane.
Since Udyr and Olaf are vastly different heroes you can decide on where they fit based on what the enemy picks.
Here is a website that shows the counterpicks for various champions, but note that it does not necessarily mean the champions laned against each other. It only means that the enemy champion was in the same game.
Here are some general rule of thumbs:
Udyr is stronger in top lane if the enemy excels at poke damage (Gangplank, Shen). He can shield their damage with his turtle stance, allowing him to trade very favorably. He has very impressive sustain and most champions cannot trade with him thanks to his turtle stance shield and impressive damage. He probably isn't going to get very many kills, but he can easily outfarm most opponents.
Olaf is stronger in top lane if the enemy is another melee bruiser, hardly anyone can trade damage with Olaf because of his true damage on his Reckless Swing [E]. If he gains an early advantage he can easily bully most champions out of lane. Heavy ranged harassers fare pretty well against him since they can force him to stay at low health.
Udyr is a very safe jungler since he sustains at high health and most champions can't kill him quickly enough before his allies assist him. He has great clear speed with his phoenix stance and clears quite quickly. He lacks a great gap closer but has a good hard cc with his bear stance that allows for slightly easier ganks.
Olaf is not nearly as safe so he is a better pick against junglers that aren't known for early counter jungling. He keeps very low health during his early clears, but later on not many champions can duel him without getting some sort of assistance. His early ganks depend on hitting a skill shot slow and red buff.
The glory of League of Legends is that you can decide what you want to do. You can build either of those champs to do either, depending on what you, as a player, are more comfortable with. There is even the option of doing both, where you lane with a partner top for a few levels and then drop into the jungle afterwards. Or you could Jungle and then lane.