The $p-1$ method works, by definition, whenever the multiplicative order of $a$ modulo $p$ is a divisor of $B$. If $B$ is a multiple of $p-1$, that is, the maximum possible multiplicative order of $a$, the probability is $1$.
We are concerned, then, with the case where $B$ does not contain every divisor of $p-1$. If it contains none of them, the probability is $0$.
The key challenge here is, having a number $d$ corresponding to the factors of of $p-1$ missing from $B$, to count the number of elements of $\mathbb{F}_p^{\ast}$ whose order is $(p-1)/d$ or any of its divisors. Those elements are precisely the ones for which those missing factors from their order do not affect the success of the factorization.
If $d=1$, the number of elements is $p-1$, that is, the whole range. If $d = 2$, this number is the number of elements such that $a^{(p-1)/2} = 1$, that is, the number of quadratic residues modulo $p$ (excluding 0), which happens to be $(p-1)/2$.
More generally, since $\mathbb{F}_p^{\ast}$ is cyclic every element can be represented as $g^e$, for some primitive element $g$ and an exponent $e$. Our goal is to count the number of solutions $e$ to
$$
g^{e(p-1)/d} = 1 \pmod{p}\,,
$$
or in other words
$$
e(p-1)/d = 0 \pmod{p-1}\,,
$$
which we can see is the number of multiples of $d$ up to $p-1$, i.e., $\frac{p-1}{d}$.
Let $d$ be product of factors of $p-1$ that $B$ does not contain, i.e., $d = \frac{p-1}{\gcd(p-1, B)}$. Then the probability of the order of a randomly selected $a$ splitting $n$ is given by
$$
\frac{(p-1)/d}{p-1} = \frac{1}{d}\,.
$$
For example, suppose $p = 15554690395797258751$. Now suppose $B$ contains all the factors of $p-1 = 2\cdot 3 \cdot 5^4 \cdot 11 \cdot 1021 \cdot 25013 \cdot 14765423$ except $2$. Then the probability that $p-1$ factorization works is $1/2$. If $B$ on the other hand is too low and doesn't include $14765423$, which is the more likely case, the factorization probability becomes $1/14765423$.
For $q-1$ the same considerations apply. However, when considering both $p-1$ and $q-1$ at the same time, one needs to subtract the case where both succeed, in which case there is also no factorization. Like above, suppose $d_1$ are the missing $p-1$ factors from $B$, and $d_2$ the ones from $q-1$. Then we have a probability of success
$$
\frac{1}{d_1}\left(1 - \frac{1}{d_2}\right) + \frac{1}{d_2}\left(1 - \frac{1}{d_1}\right) = \frac{1}{d_1} + \frac{1}{d_2} - \frac{2}{d_1d_2}\,,
$$
that is, $p-1$ succeeds and $q-1$ fails, or $q-1$ succeeds and $p-1$ fails.