Is the prior in Bayes formula a probability or it can also represent a probability distribution? Given the Bayes formula:
$$ p(\theta|D) = \dfrac{p(D|\theta)p(\theta)}{p(D)} $$
If there is a distribution (let's say $g$) over the parameter $\theta$, how should one rewrite the Bayes formula?
$D$ is the evidence and $\theta$ is the prior (model parameters).

Bayes formula assumes that there is a distribution over every quantity, so there is no need to rewrite it.
Bayes formula applies to both discrete and continuous random quantities. If the quantities are discrete then the $p()$ are probability mass functions. If the quantities are continuous, then the $p()$ are probability density functions.
You refer to the possibility of "fixed" quantities in your comments, but there are no fixed quantites in Bayes formula. If $\theta$ was fixed (i.e., known) then the formula would be pointless. If $D$ was fixed, then it could not provide evidence about $\theta$. In Bayesian applications, $D$ is observed and $\theta$ is an unknown parameter that determines the distribution of $D$. In this context, $p(D|\theta)$ is the likelihood function, the probability (i.e., the likelihood) of observing that particular $D$ value as a function of $\theta$.
