  The polarized Galactic synchrotron and thermal dust emission constitutes a
major tool in the study of the Galactic magnetic field (GMF) and in
constraining its strength and geometry for the regular and turbulent
components. In this paper, we review the modeling of these two components of
the polarized Galactic emission and present our strategy for optimally
exploiting the currently existing data sets. We investigate a Markov Chain
Monte Carlo (MCMC) method to constrain the model parameter space through
maximum-likelihood analysis, focusing mainly on dust polarized emission.
Relying on simulations, we demonstrate that our methodology can be used to
constrain the regular GMF geometry. Fitting for the reduced Stokes parameters,
this reconstruction is only marginally dependent of the accuracy of the
reconstruction of the Galactic dust grain density distribution. However, the
reconstruction degrades, apart from the pitch angle, when including a turbulent
component on the order of the regular one as suggested by current observational
constraints. Finally, we applied this methodology to a set of $Planck$
polarization maps at 353 GHz to obtain the first MCMC based constrains on the
large-scale regular-component of the GMF from the polarized diffuse Galactic
thermal dust emission. By testing various models of the dust density
distribution and of the GMF geometry, we prove that it is possible to infer the
large-scale geometrical properties of the GMF. We obtain coherent
three-dimensional (3D) views of the GMF, from which we infer a mean pitch angle
of 27 degrees with 14 % scatter, which is in agreement with results obtained in
the literature from synchrotron emission.
