We study the energy spectra of bound states in quantum dots (QDs) formed by an electrostatic potential in two-dimensional topological insulator (TI) and their transformation with changes in QD depth and radius. It is found that, unlike a trivial insulator, the energy difference between the levels of the ground state and first excited state can decrease with decreasing the radius and increasing the depth of the QD so that these levels intersect under some critical conditions. The crossing of the levels results in unusual features of optical properties caused by intracenter electron transitions. In particular, it leads to significant changes of light absorption due to electron transitions between such levels and to the transient electroluminescence induced by electrical tuning of QD and TI parameters. In the case of magnetic TIs, the polarization direction of the absorbed or emitted circularly polarized light is changed due to the level crossing.