This paper proposes and analyzes arbitrarily high-order discontinuous Galerkin (DG) and finite volume methods which provably preserve the positivity of density and pressure for the ideal magnetohydrodynamics (MHD) on general meshes. Unified auxiliary theories are built for rigorously analyzing the positivity-preserving (PP) property of numerical MHD schemes with a Harten–Lax–van Leer (HLL) type flux on polytopal meshes in any space dimension. The main challenges overcome here include establishing certain relation between the PP property and a discrete divergence of magnetic field on general meshes, and estimating proper wave speeds in the HLL flux to ensure the PP property. In the 1D case, we prove that the standard DG and finite volume methods with the proposed HLL flux are PP, under a condition accessible by a PP limiter. For the multidimensional conservative MHD system, the standard DG methods with a PP limiter are not PP in general, due to the effect of unavoidable divergence error in the magnetic field. We construct provably PP high-order DG and finite volume schemes by proper discretization of the symmetrizable MHD system, with two divergence-controlling techniques: the locally divergence-free elements and suitably discretized Godunov–Powell source term. The former technique leads to zero divergence within each cell, while the latter controls the divergence error across cell interfaces. Our analysis reveals in theory that a coupling of these two techniques is very important for positivity preservation, as they exactly contribute the discrete divergence terms which are absent in standard multidimensional DG schemes but crucial for ensuring the PP property. Several numerical tests further confirm the PP property and the effectiveness of the proposed PP schemes. Unlike the conservative MHD system, the exact smooth solutions of the symmetrizable MHD system are proved to retain the positivity even if the divergence-free condition is not satisfied. Our analysis and findings further the understanding, at both discrete and continuous levels, of the relation between the PP property and the divergence-free constraint.