The excitation of lattice vibrations by ultrafast laser pulses provides a tool to steer atomic-scale motions beyond usual thermodynamic limitations. We simulate this process in armchair, chiral, and zigzag boron nitride nanotubes (BNNTs). In particular, for ultrathin zigzag-type tubes we show that three vibrational modes can be displacively excited. Since the boron nitride bonds are polar, the three coherent phonon oscillations emit terahertz (THz) radiation. In this work we focus on the (5,0) zigzag BNNT, which is the thinnest stable one, and demonstrate, by means of ab initio molecular dynamics simulations and optimization algorithms, that the relative amplitudes of the three phonon modes and therefore the corresponding shape of the emitted THz short pulse can be controlled by laser-pulse trains. Our work could serve as a basis for experimental studies using the coherent vibrations of BNNTs as optical memory devices in nanophononics, since information could be written in the phononic system by several femtosecond laser pulses and could be read out by measuring the produced THz emission.