Can I transform a parameter's posterior to a different parametrization? I have a model with several parameters. I apply Bayesian inference with a uniform prior for all of the parameters. After the process is finished, I realize that I need one of those parameters $x$ parametrized as its logarithm:
$$y = log(x/a)$$
where $a$ is a constant. As far as I understand, a uniform prior in $x$ is a very much non-uniform prior in $y$.
Can I transform the posterior I got using a uniform prior in  $x$ into a posterior with a uniform prior in $y$?

First, for a uniform prior on $x$, the corresponding prior on $y$ is given by
$$
p(y) = p(x) \left\vert\frac{dy}{dx}\right\vert^{-1} \propto x.
$$
Using this Jacobian, you can re-weight the posterior to a flat prior on $y$.
If you are using python and pandas for the analysis, you may find the following code useful.
y = np.log(samples['x'] / a)
J = samples['x'] # Jacobian
weights = 1 / J
weights /= np.sum(weights) # normalization
plt.hist(samples['y'], weights=weights, bins=50, deisnty=True)

The resulting histogram would be the posterior on $y$ given a uniform prior on $y$. Or you can simply resample based on the weight. But this method is not perfect as it could suffer from a low effective sample size $n_{\rm eff}$, which is given by
$$
n_{\rm eff} = \frac{(\sum_{i=1}^n w_i)^2}{\sum_{i=1}^n w_i^2},
$$
where $w_i = 1 / x_i$ for your case. A re-analysis with a uniform prior on $y$ is always a better way.
You may find an example plot as follows

This plot nicely shows both the method works and also its shortcomings.

*

*The resulting distribution is uniform for relatively higher $y$

*For lower $y$, because there are no samples with such a low value to begin with, the reweighting does not help.

