No, that is just a common example. The law applies to any object or material which can have elastic deformation under stress development provided it behaves as per Hooke’s Rule.