The results of X-ray and neutron diffraction study as well as the elastic, magnetic and magnetotransport properties of La0.88MnOx, La1-xBixMnO3, Nd1-xCaxMnO3, Eu1-xCaxMnO3 manganites and La1-xSrxCoO3, Nd1-xBaxCoO3 cobaltites have been presented. The transition to ferromagnetic state is observed for these systems under oxygen or Bi, Ca, Sr, Ba doping. In manganites, the transition to ferromagnetic state correlates with the change of the type of Jahn-Teller distortions from static to quasistatic and then of dynamic ones. The quasistatic and dynamic orbital correlations favour ferromagnetic state, while A-type antiferromagnetic state is typical for the static Jahn-Teller distortions. The possible types of orbital structures and their relationship with the magnetic structures are discussed. It is argued that the canting magnetic structure in manganites is not realized. The transition to ferromagnetic state occurs via the formation of inhomogeneous state with different type of orbital correlations and magnetic structure. The key role of intrinsic chemical inhomogeneity in the formation of inhomogeneous magnetic states in solid solutions of manganites and cobaltites is emphasized. The influence of orbital correlations on the formation of ferromagnetic state and metal-insulator transition in cobaltites is discussed.