God spoke this warning to two Church's in Revelations. One being the Church at Ephesus and the Church at Pergamos.
The Nicolaitans were a Gentile heretic sect that converted over to Judaism to dominate others with their heretic teachings. Irenaeus, Hippolytus, Epiphanius, and Theodoret mentioned this group, and stated that the deacon Nicolas was the author of the heresy and the sect. The Nicolaitanes are the followers of that Nicolas who was one of the seven first ordained to the diaconate by the apostles in AD 33, Acts 6:5. They lead lives of unrestrained indulgence as in eating things offered to idols. The teaching of the Nicolaitans was to dominate the people leading them astray from that of what Jesus taught and this goes against the teachings of Jesus, Matthew 20:25-28.
Rev 2:6 But this thou hast, that thou hatest the deeds of the Nicolaitans, which I also hate.
Rev 2:15 So hast thou also them that hold the doctrine of the Nicolaitans, which thing I hate.
Act 6:5 And the saying pleased the whole multitude: and they chose Stephen, a man full of faith and of the Holy Ghost, and Philip, and Prochorus, and Nicanor, and Timon, and Parmenas, and Nicolas a proselyte of Antioch: