This is a lengthy question to answer, but generally speaking the same species works, but not always the same genus. For example, euphyllia, frogspawn, hammers, and octospawns can touch, while torches cannot touch either of those without doing harm. But chemical warfare between species of coral is a major thing! Certain LPS, like Lobos, will quickly kill an encrusting coral like Leptos with minimal contact. However, I have seen huge colonies of zoas next to the same Lobo that aren't bothered at all. But there are many many many other situations of corals living side by side, and dying side by side.