How to override a module in sites/all/modules directory?
Answering my own question here:


  Your installation will choose from the most specific one available
  (first /sites/sitename/modules (sitename typically might be - default), then /sites/all/modules, then
  /modules).


from Directory precedence and multi-site considerations.