Competition law aims to prevent collaborations which reduce competition. In most cases, this only applies if you have a combined market share of more than 25 per cent.
Some forms of collaboration are strictly prohibited in any circumstances: for example, agreements to fix prices or to share markets. On the other hand, there are some limited exceptions which can, for example, allow collaboration on research and development.
Competition law is complex. If in any doubt, take legal advice.