I feel that Scout against Pyro is perhaps the most difficult confrontation between classes. Scout has the lowest amount of health in the game (alongside Engineer, Sniper and Spy) and Pyro's flamethrower can kill him nearly instantly. Close encounters must be avoided, making shotguns far less useful. I can only see some items such as Shortstop and Mad Milk changing the situation. Jumping around with related items (Winger, Atomizer) equipped may be viable, but experienced Pyro players should be able to take the Scout down as the flamethrower doesn't demand accurate aim.
Is it recommended to avoid direct confrontations with Pyro entirely?
UPDATE: This question was written before a major update:
Flamethrowers were able to do full damage regardless of the spread of their flames, rewarding maximizing flame spread over focusing on a target. We've made changes geared toward preserving the current damage range of flamethrowers, but requiring better aim to do so.
- Flame damage per second now ramps up based on density of flame encountered, up to 200%
- Initial flame damage per second reduced by 50%, resulting in the max damage being unchanged