On the physics potential to study the gluon content of proton and deuteron at NICA SPD