For commercial texting in the US, it is supposed to be opt-in.
Of course, there are unscrupulous parties who don't respect this.