As Greg Martin points out, you cannot do this, if $a$ and $b$ are both divisible by $p$. So assume that at least one of them, say $a$, is not divisible by $p$. In that case you can select $d$ any which way you want (IOW the system is underdetermined). Here's how:
1) (Pre)compute a modular inverse of $a$. This is an integer with property $aa'\equiv1\pmod p$. It can be found by a single run of an extended Euclidean algorithm. If the same $a,p$ are used many times, then we can obviously store the result for future reuse.
2) Compute the integer $c=a'(1+bd) \pmod p$, and lean back content. Here's why that works
$$
a\cdot c=a\cdot a'(1+bd)\equiv 1+bd\pmod p,
$$
because $a\cdot a'\equiv 1\pmod p$. That congruence is clearly equivalent to the desired congruence (move the term $bd$ to the other side and swap its sign).
===============================
IOW, if $(a,p)=1$ (or $(b,p)=1$), then what you have is essentially a single linear equation in two variables with parameters ranging over the field $\mathbf{Z}_p.$ Under such circumstances you can choose one of the unknowns arbitrarily and solve for the other. There will be exactly $p$ pairwise non-congruent solutions.