While microbes or other one-celled organisms cannot think, they can react to stimuli and have programmed actions that allow it to live and reproduce. Thinking is not required. Their activities are governed by conditioned primordial responses to external stimulus.
Our cells respond in much the same manner. While each cell is unable to think, they do have a "memory" of what happens to them. So, while individual cells cannot formulate thoughts or plan out any activities, they can hold a memory of anything that happens to them. This may change their reaction to stimulus in the future; but, it is not a conscious, thought out change.