Multidimensional extensions of the Grothendieck inequality and applications