God can be cursed only when He wishes it this way. Here is an example of Narada's curses on Sri Vishnu in a story that took place like this.
There is a story of sage Narada and Vishvamohini. Once Narada, on seeing Vishvamohini, forgot all about his dispassion and thought to devise some means so that the beautiful princess may choose him for her husband. Narada prayed to Sri Hari and requested the God for His own beauty to get possession of Vishvamohini. In the sage's own interest the gracious God had made him ugly (with monkey-like face) beyond description. But no one could mark the change that had taken place in Narada.
Narada went and sat where the arena for the choice-marriage had been prepared. The princess alone saw his ugly form. The moment she beheld his monkey-like face and frightful form she was filled with rage. She moved on to the next and did not care to give even a second look. On seeing his reflection in water, the sage was filled with fury and cursed Sri Hari. This is narrated in Tulasidas' Sri Ramacharitamanas, Balkand (here-page 101, search page 21). Here is the curse:
You made me look like a monkey; therefore You shall have monkeys for Your helpmates. And as You have grievously wronged me, so shall You suffer the pangs of separation from Your wife. Gladly accepting the curse, the compassionate Lord made many entreaties to the sage, and withdrew the irrestible charm of His Maya. When Sri Hari lifted the spell of His Maya, there was neither Ramaa nor the princess to be seen by His side. In dire dismay the sage then clasped the feet of Hari and said, "O Reliever of the distress of the suppliant, save me! O gracious lord! let my curse prove ineffectual." "It was My will", replied the Lord, who is so merciful to the humble.
Therefore, as is evident from the story that God can be cursed only when He wishes to be cursed.
The above incident was one of the reasons responsible for incarnation of Sri Rama. As Sri Rama, Sri Hari suffered separation from His wife (Sri Sita) and had monkeys as His helpmates.