There are a lot of different species of both types of fish, but generally you can keep them together.
With any SW fish, there is no hard fast rule, even fish that usually live together may not in a specific tank. Always be prepared to find a new home for something that doesn't work out.