Yes, but the complication is that in this case the sexism that comes AFTER the original comment is if anything more problematic. After all, even your friends can offend you. Part of what makes friendship and trust possible is that we often simply accept quirks and boundaries with good grace even if those boundaries do not hit us as particularly sensible.
For example, I've got a friend who weighs at least 3 bills. In grade school I guess some other kids used to call him "House" and it wasn't in reference to a TV doctor. He makes the occasional self-deprecating fat joke, but he doesn't like it even when friends give him guff on the matter even if he knows we don't really think of him as wandering around with a badge of shame. I teased him about it once, he called me on it, and I just let it drop. Seemed a little silly to me since even he jokes about his weight and we are good friends and I mean him all the best in the world, but then, I'm on the outside looking in here. I don't really know how much bs he takes over this. So I let it slide because he doesn't want his weight to be a topic of public interest and I go with that because that's what friends do. Likewise, I prefer that people do not bring up my shitty handwriting.
With women, sexism and society, however, that's not often how it goes down. A woman setting down boundaries about sexually charged comments often really does end up on the defensive because the comments really are often parsed as an attack on men and there really are guys out there with a big ol' siege mentality on this subject. To put it bluntly, the male response to "Please don't call me babycakes" has often been "Man, don't be so uptight." Or even worse, "Justify why it's bad first, that way I can pick the argument to death-- and maybe afterwards slap your ass."