Stochastic Background of Gravitational Wavesas a Benchmark for Extended Theories of Gravity