We present a theory of local electric polarization in crystalline solids and apply it to study the case of wurtzite group-III nitrides. We show that a local value of the electric polarization, evaluated at the atomic sites, can be cast in terms of a summation over nearest-neighbor distances and Born effective charges. Within this model, the local polarization shows a direct relation to internal strain and can be expressed in terms of internal strain parameters. The predictions of the present theory show excellent agreement with a formal Berry-phase calculation for random distortions of a test-case CuPt-like InGaN alloy and InGaN supercells with randomly placed cations. While the present level of theory is appropriate for highly ionic compounds, such as III-N materials, we show that a more complex model is needed for less ionic materials, such as GaAs, in which the strain dependence of Born effective charges has to be taken into account. Moreover, we provide ab initio parameters for GaN, InN, and AlN, including hybrid functional values for the piezoelectric coefficients and the spontaneous polarization, which we use to accurately implement the local theory expressions. In order to calculate the local polarization potential, we also present a point dipole method. This method overcomes several limitations related to discretization and resolution which arise when obtaining the local potential by solving Poisson's equation on an atomic grid. Finally, we perform tight-binding supercell calculations to assess the impact of the local polarization potential arising from alloy fluctuations on the electronic properties of InGaN alloys. In particular, we find that the large upward bowing with composition of the InGaN valence-band edge is strongly influenced by local polarization effects. Furthermore, our analysis allows us to extract composition-dependent bowing parameters for the energy gap and valence-and conduction-band edges.