I think they could relate to each other somewhat.
Cordelia: She was the queen bee of Sunnydale high, now that's over, she's poor and doesn't really know her place.
Anya: She was a demon feared by men for centuries, now that's over, she's powerless and doesn't really know her place.
Whether that would translate to friendship... I dunno. I think Cordelia, even if she had stayed in Sunnydale, would still develop and grow up. So even if she liked Anya early on, I'm not sure how well Anya's gleeful reminiscing of slaughter would go down later on. If Anya developed with her, then perhaps. Then again, maybe Cordelia would just be all "Oh that zany Anya!" like everyone else was.