Let $A$ be a set.
If $A \subset \mathbb{R}^n$ is Euclidean, it is convex iff for any $x,y \in A$, the line segment $tx + (1-t)y, \;\; t\in [0,1]$ is contained in $A$.
If $A$ is a geodesic space, it is convex iff for any $x,y \in A$, the geodesic curve between $x$ and $y$ is contained in $A$.
If $A$ is an arbitrary metric space, the "line segment" between $x,y \in A$ is defined as $Z_{x,y} = \{ z: d(x,z) + d(y,z) = d(x,y)\}$. So $A$ is convex iff $Z_{x,y} \in A$ for every $x,y\in A$. But this set $Z_{x,y}$ seems hard to describe for any two points $x,y \in A$. For example if our metric space is $(A \subset P(\mathbb{R}^n), W_2)$, i.e. probability densities with optimal transport distance, then it is already a difficult task to compute $W_2(x,y)$ let alone find all points along $Z_{x,y}$. So how would one prove that a subset is convex?
(On the other hand, is $(A, W_2)$ a geodesic space? In which case the geodesic between measures $x,y$ corresponds to an optimal transport plan between $x$ and $y$ and so convexity of $A$ would boil down to whether the optimal transport plan stays within $A$. But I am still not sure how one could prove this)