Note: This answer takes the definition of a metric basis as an inclusion-minimal metric generating set. This definition is non-standard. Another answer deals with the same topics but takes the standard view of metric bases as cardinality-minimal metric generating sets.
Let's define the weak metric dimension of a metric space to be the common size of all inclusion-minimal generating sets, if this common value exists.
First I'll characterize those finite metric spaces with well-defined weak metric dimension in terms of the purity of a related simplicial complex and then briefly talk about how matroids fit into the picture.
Simplicial Complex Background
We will need some terminology for (abstract) simplicial complexes. A simplicial complex on a set $S$ is a collection of subsets $\Delta$ of $S$ that is closed under taking subsets, that is, if $T \in \Delta$ and $T' \subseteq T$, then $T' \in \Delta$. The elements of $\Delta$ are called its faces and the inclusion-maximal faces are the facets of $\Delta$. The rank of a face $F$ is given by $r(F)=\#F$ and the rank of $\Delta$, denoted $r(\Delta)$, is the largest rank of a face in $\Delta$.
Note that for a general simplicial complex, the cardinality of two facets need not be equal. (Example: $([3], \{\emptyset, 1, 2, 3, 23\})$.) However, if all facets do have the same cardinality the simplicial complex is called pure.
A (nearly trivial) characterization
Let $(M,d)$ be a finite metric space and let $\mathcal{G}$ be the collection of all generating sets for $(M,d)$. Define the set
$$\Delta = \Delta(M,d) := \{M \setminus G~|~G \in \mathcal{G}\}.$$
Note that if $G' \supseteq G$ and $G \in \mathcal{G}$ then $G' \in \mathcal{G}$. This impies that the set $\Delta$ is an abstract simplicial complex on $M$. The facets of $\Delta$ correspond to inclusion-minimal generating sets of $(M,d)$ by set complementation. So the metric dimension of the finite metric space $(M,d)$ is well-defined (using this nonstandard definition) if and only if the complex $\Delta(M,d)$ is pure. In this case, $\dim(M,d) = \#M - r(\Delta)$.
Example
Now let me try to tie this into the discussion of Example 1 of this answer to the previous question. In that example we have $M = \{0,1,2,3\}$ and $d$ given by
$$d(x,y) = \begin{cases} 2 \text{ if } x,y \neq 0 \\ 2 + \frac{1}{y} \text{ if } x = 0. \end{cases}$$
One computes that the metric generating sets consist of all subsets of $\{0,1,2,3\}$ except for the empty set and the singletons $\{i\}$ where $i \in [3]$. So $\Delta(M,d)$ is the simplicial complex whose faces are arranged by containment in the following poset. So $\Delta(M,d)$ is not pure (it has three facets of rank two and a facet of rank three) and so the metric dimension (using this nonstandard definition) of $\Delta(M,d)$ is not well-defined.
Let us note that using the standard definition of metric dimension $(M,d)$ has metric dimension one since its only metric basis is $\{0\}$; see this answer to this post for more on the standard case.
Matroids
For an arbitrary finite metric space $(M,d)$, the complex $\Delta(M,d)$ is a matroid (that is, its facets satisfy the basis exchange axiom for matroids) if and only if the "matroid dual" complex
$$\Delta^*(M,d) := \{H \subseteq G | G \text{ is inclusion-minimal in } \mathcal{G}\}$$
is a matroid. In this case the metric dimension of $(M,d)$ is just the rank of $\Delta^*(M,d)$.
Let $f(n)$ be the number of simple, connected graphs on $n$ and $g(n)$ be the number of such graphs such that the weak metric dimension on the natural metric space $M(G)$ is well-defined. Also, let $h(n)$ be the number of those graphs counted by $g(n)$ whose weak metric bases are matroidal. Then using some Macaualay2 scripts we have the following values.
n = 1 2 3 4 5 6 7
f(n) = 1 1 2 6 21 112 853
g(n) = 1 1 2 5 17 69 437
h(n) = 1 1 2 5 16 61 290
One should compare this table to the similar table in this answer.