We present a first principles calculation on the electronic structure and optical properties of ultrasmall-diameter (2,2) boron nitride, silicon carbide, and carbon nanotubes (BNNT, SiCNT, and CNT) by using full potential linear augmented plane wave (FP-LAPW) and pseudo potential plane wave (PP-PW) methods. The atomic geometries of all considered models are optimized. Calculations of optical spectra are performed under electric fields polarized both parallel and perpendicular with respect to the nanotube (NT) axis. Our results show that the dielectric function is anisotropic and it is revealed that (2,2) SiCNT would be better dielectric material than (2,2) BNNT.We have calculated the first, second and third optical transitions for the considered models. The value of the optical gap for (2,2) BNNT is obtained much larger than that of (2,2) SiCNT and (2,2) CNT. The results show that contrary to the (2,2) CNT being metallic, the (2,2) BNNT, and (2,2) SiCNT are wide indirect gap semiconductors. We also present the energy loss function; in this case the intertube interactions play an important role with respect to the optical spectroscopy. Our results revealed that unlike the dielectric function, the calculated energy loss function show rather weak anisotropy.