One of my contacts is in the UK right now on tourist visa which has 6 months validity. He wants to travel to Europe and, for that, he needs a Schengen visa. Can he apply from within the UK, or he has to apply from his country of residence?
The general rule is that one must apply for Schengen visas in one's county of residence. Being in the UK on a tourist trip doesn't make your acquaintance a resident there, so ordinarily he wouldn't be allowed to file a visa application there.
The consulates are allowed to consider visa application from non-resident, if he can provide a good and convincing reason why he couldn't apply from his home country. Simply wanting to go on a pleasure trip won't cut it; a suddenly arising emergency or business need might well do.