This is a good question. On the surface, Lennie and Curley's wife are completely different. Lennie is a man, a migrant worker, and slow mentally. Curley's wife is a woman, and the wife of the owner's son, and sharp.
However, when we delve into their characters more deeply, we can see that they connect on a certain level, which leads to disastrous results.
Curley's wife is lonely. She believes that she is in a dead-end marriage. She feels alienated on a farm with only men. She also believes that she could have done more with her life. Within this context, she wants companionship from a kind person. Lennie is such a person. He is kind and available - partially because Lennie is not like the other men. So, they form a "friendship." However, Curley's wife does not understand that Lennie is slow. So, when they begin to interact, Lennie says that he likes to pet soft things. Curley's wife says that her hair is soft. When he pets it too hard, she gets scared and he snaps her neck by accident. All of this is tragic.