More specifically two atoms but this is indeed true. The elements do not need to be different but there can only be two atoms. The prefix indicates the quantity of two. Di - means "of two".
Diatomic molecules typically refer to atoms that come in pairs. For example, you will never find a lone oxygen naturally. In nature it is always found as O2.