Wlog we can use $v_{n-2}$ and $v_{n-1}$ instead of $v_1$ and $v_2$. Then if we let $B_n \subset T_n$ be the set of labelled trees with edges $(v_{n-2}, v_n)$ and $(v_{n-1}, v_n)$, the count for $A_n$ is just $(n-2)$ times the count for $B_n$ (there are $n-2$ choices for $v_t$; swap $v_t$ for $v_n$ if they're different).
The advantage to numbering things this way is that when constructing the Prüfer codes for the trees in $B_n$ the three labelled vertices are the last survivors. The final label in the Prüfer code will be $n$, and the penultimate one (if $n > 3$) will be in $\{n-2, n-1, n\}$. This appears empirically also be to sufficient, although a proof eludes me at present.
If so then the number of trees with given vertex degrees $d_i$ (where each $d_i \ge 1$ and $d_n \ge 2$) having subtree $v_{n-1} - v_n - v_{n-2}$ is a sum of three multinomial coefficients which simplifies to $$\binom{n-2}{d_1-1, \ldots, d_n-1} \frac{(d_n - 1)(d_{n-2} + d_{n-1} + d_n - 4)}{(n-3)(n-2)}$$
Then taking the alternative formulation
For given $d_1,...,d_{n} \in \{1,...,n-1\}^n$ with $d_1+...+d_n = 2n-2$, how many of the ${n-2 \choose d_1-1,...,d_{n}-1}$ many $T \in T_n$ with $d_i = \deg_{T}(v_i) = \deg_{D(T)}(v_i)$ satisfy the condition that $v_1$ and $v_2$ have distance two?
the answer is given by relabelling to put the special vertices at $v_1$, $v_2$ and summing over all possible intermediate vertices. $$\sum_{i=3}^n [d_i \ge 2] \binom{n-2}{d_1-1, \ldots, d_n-1} \frac{(d_i - 1)(d_1 + d_2 + d_i - 4)}{(n-3)(n-2)}$$ simplifies to $$\frac{1}{(n-3)(n-2)} \binom{n-2}{d_1-1, \ldots, d_n-1} \left((n - d_1 - d_2)(d_1 + d_2 - 5) - (n-2) + \sum_{i=3}^n d_i^2 \right)$$