Hexagonal boron nitride (h-BN) is a well-known layered van der Waals (vdW) material that exhibits no spontaneous electric polarization due to its centrosymmetric structure. Extensive density functional theory (DFT) calculations are used to demonstrate that doping through the substitution of B by isovalent Al and Ga breaks the inversion symmetry and induces local dipole moments along the c-axis, which promotes a ferroelectric (FE) alignment over antiferroelectric. For doping concentrations below 25%, a "protruded layered" structure in which the dopant atoms protrude out of the planar h-BN layers is energetically more stable than the flat layered structure of pristine h-BN or a wurtzite structure similar to w-AlN. The computed polarization, between 7.227 and 21.117 μC/cm2, depending on dopant concentration and the switching barrier (16.684 and 45.838 meV/atom) for the FE polarization reversal are comparable to that of other well-known FEs. Interestingly, doping of h-BN also induces a large negative piezoelectric response in otherwise nonpiezoelectric h-BN. For example, we compute d33 of -24.214 pC/N for Ga0.125B0.875N, which is about 5 times larger than that of pure w-AlN (5 pC/N), although the computed e33 (-1.164 C/m2) is about 1.6 times lower than that of pure w-AlN (1.462 C/m2). Because of the layered structure, the rather small elastic constant C33 provides the origin of the large d33. Moreover, doping makes h-BN an electric auxetic piezoelectric. We also show that ferroelectricity in doped h-BN may persist down to its trilayer, which indicates high potential for applications in FE nonvolatile memories.