Molybdenum disulfide (MoS2) is the second two-dimensional material after graphene that received a lot of attention from the research community. Strong S–Mo–S bonds make the sandwich-like layer mechanically and chemically stable, while the abundance of precursors and several developed synthesis methods allow obtaining various MoS2 architectures, including those in combinations with a carbon component. Doping of MoS2 with heteroatom substituents can occur by replacing Mo and S with other cations and anions. This creates active sites on the basal plane, which is important for the adsorption of reactive species. Adsorption is a key step in the gas detection and electrochemical energy storage processes discussed in this review. The literature data were analyzed in the light of the influence of a substitutional heteroatom on the interaction of MoS2 with gas molecules and electrolyte ions. Theory predicts that the binding energy of molecules to a MoS2 surface increases in the presence of heteroatoms, and experiments showed that such surfaces are more sensitive to certain gases. The best electrochemical performance of MoS2-based nanomaterials is usually achieved by including foreign metals. Heteroatoms improve the electrical conductivity of MoS2, which is a semiconductor in a thermodynamically stable hexagonal form, increase the distance between layers, and cause lattice deformation and electronic density redistribution. An analysis of literature data showed that co-doping with various elements is most attractive for improving the performance of MoS2 in sensor and electrochemical applications. This is the first comprehensive review on the influence of foreign elements inserted into MoS2 lattice on the performance of a nanomaterial in chemiresistive gas sensors, lithium-, sodium-, and potassium-ion batteries, and supercapacitors. The collected data can serve as a guide to determine which elements and combinations of elements can be used to obtain a MoS2-based nanomaterial with the properties required for a particular application.