Can a context-senstive gramma contains production rule $cB\rightarrow Bc$?
Your confusion is not unexpected. That grammar is not a context-sensitive grammar in its usual strict sense.

However, that grammar can be considered as a context-sensitive grammar in some situations. The Wikipedia entry on context-sensitive grmmar reads the following.


  Some definitions of a context-sensitive grammar only require that for any production rule of the form $u \to v$, the length of $u$ shall be less than or equal to the length of $v$. This seemingly weaker requirement is in fact weakly equivalent, see Noncontracting grammar#Transforming into context-sensitive grammar.


You may want to double check the definition of CFG and exposition thereafter in the textbook you mentioned.