Duality for composed convex functions with applications in location theory