Short answer
Not in all things, by his own scripture's account. In the Gita, Krishna says that people copy whatever a great man does, and that is why he keeps acting. But the Bhagavata Purana, which tells his life, adds a warning. King Parikshit asks how Krishna, who came to restore dharma (the right order of life), could act as he did with other men's wives. The sage answers that the mighty are not stained, as fire is not. No ordinary person, he says, should copy such acts even in thought; follow the words of the mighty. In Islam, God's (﷾) messengers are men whose whole lives are meant to be followed. The Qur'an calls Muhammad (ﷺ) "a beautiful pattern (of conduct)" (33:21).
Full explanation
The Gita: people copy the great one
In the Gita, Krishna tells Arjuna why a leader must act well. "Whatever a great man does, that other men also do. And people follow whatever he receives as authority." Krishna then speaks of himself. He has nothing to gain in all the worlds, yet he keeps acting. "For should I at any time not engage without sloth in action, men would follow in my path from all sides". If he stopped acting, he says, "these worlds would be destroyed". So in the Gita, Krishna's own conduct is a pattern that people copy.
“Whatever a great man does, that other men also do. And people follow whatever he receives as authority.”
“There is nothing, O son of Prithâ! for me to do in (all) the three worlds, nothing to acquire which has not been acquired. Still I do engage in action. For should I at any time not engage without sloth in action, men would follow in my path from all sides, O son of Prithâ!”
“If I did not perform actions, these worlds would be destroyed, I should be the cause of caste-interminglings; and I should be ruining these people.”
The Bhagavata: do not copy these acts
The Bhagavata Purana is the best-loved telling of Krishna's life. It is smriti, the remembered tradition, and its tenth book tells of his life, beginning with his youth in Vrindavan. In chapter 33, after the rasa dance with the cowherd women (gopis), King Parikshit raises a question. Krishna came to destroy wrong and restore dharma, and he is its speaker and guardian. How then, the king asks, could he act as he did with other men's wives? The sage Shuka answers that an apparent breach of dharma does not harm the mighty, as fire burns everything and stays pure. One who is not mighty, he says, must never copy it, even in thought. The wise follow what of their conduct agrees with their words.
After the rasa dance, King Parikshit asks the sage Shuka a question. The Lord descended to destroy irreligion and restore dharma, and he is its speaker, follower and guardian. How then could he act against it by touching other men's wives, and what was his purpose (vv. 26-28)? Shuka answers that an apparent breach of dharma does not harm the mighty, as fire consumes everything and stays pure (v. 29). One who is not mighty must never do the same, even in mind. If he does it out of folly he is destroyed, like anyone but Rudra (Shiva) who drank the poison from the ocean (v. 30). The words of the mighty are true, and a wise person follows what of their conduct agrees with their words (v. 31).
Two teachings side by side
This page does not retell the stories. It asks what a follower can do with them. In the Gita, people copy what the great man does, and Krishna acts so that they will. In the Bhagavata, some of his acts must never be copied, even in thought. So a devotee must sort Krishna's deeds into those to follow and those to leave. The Bhagavata's own rule is to follow the words of the mighty, and their deeds only where the two agree. A pattern that must first be sorted cannot be the pattern for the whole of life.
“Whatever a great man does, that other men also do. And people follow whatever he receives as authority.”
After the rasa dance, King Parikshit asks the sage Shuka a question. The Lord descended to destroy irreligion and restore dharma, and he is its speaker, follower and guardian. How then could he act against it by touching other men's wives, and what was his purpose (vv. 26-28)? Shuka answers that an apparent breach of dharma does not harm the mighty, as fire consumes everything and stays pure (v. 29). One who is not mighty must never do the same, even in mind. If he does it out of folly he is destroyed, like anyone but Rudra (Shiva) who drank the poison from the ocean (v. 30). The words of the mighty are true, and a wise person follows what of their conduct agrees with their words (v. 31).
A man whose whole life is the example
Islam teaches that God (﷾) guides people through messengers who are men like them. The Prophet (ﷺ) was told to say: "I am but a man like yourselves, (but) the inspiration has come to me" (18:110). Because he is a man, his life can be followed. The Qur'an says: "Ye have indeed in the Messenger of Allah a beautiful pattern (of conduct)" (33:21). It tells believers: "So take what the Messenger assigns to you, and deny yourselves that which he withholds from you" (59:7). His wife Aisha was once asked about his character. She said that his character was the Qur'an (Muslim 746). His words and his deeds point the same way.
“Say: "I am but a man like yourselves, (but) the inspiration has come to me, that your Allah is one Allah: whoever expects to meet his Lord, let him work righteousness, and, in the worship of his Lord, admit no one as partner.”
“Ye have indeed in the Messenger of Allah a beautiful pattern (of conduct) for any one whose hope is in Allah and the Final Day, and who engages much in the Praise of Allah.”
“What Allah has bestowed on His Messenger (and taken away) from the people of the townships,- belongs to Allah,- to His Messenger and to kindred and orphans, the needy and the wayfarer; In order that it may not (merely) make a circuit between the wealthy among you. So take what the Messenger assigns to you, and deny yourselves that which he withholds from you. And fear Allah; for Allah is strict in Punishment.”
Sa'd ibn Hisham asked Aisha about the character of the Prophet (ﷺ). She asked him whether he did not read the Qur'an, and said that the character of the Prophet was the Qur'an.
God (﷾) never commands what is shameful
The Qur'an speaks of people who did shameful things and said that God (﷾) had commanded them. It answers: "Nay, Allah never commands what is shameful: do ye say of Allah what ye know not?" (7:28). In Islam, God's (﷾) commands and His messengers' lives agree. Nor does God (﷾) come as a man to act among people: "there is nothing whatever like unto Him" (42:11). The page "Did God become a man as Rama or Krishna?" looks at that question in full.
“When they do aught that is shameful, they say: "We found our fathers doing so"; and "Allah commanded us thus": Say: "Nay, Allah never commands what is shameful: do ye say of Allah what ye know not?"”
“(He is) the Creator of the heavens and the earth: He has made for you pairs from among yourselves, and pairs among cattle: by this means does He multiply you: there is nothing whatever like unto Him, and He is the One that hears and sees (all things).”
Islam's answer: love shown by following
Hindu devotion rightly seeks the love of God (﷾). The Qur'an joins that love to a life that anyone can live. It says: "If ye do love Allah, Follow me" (3:31). In Islam, the messenger who teaches love of God (﷾) is also the pattern for conduct. Islam is a complete way of life: worship, family, work and justice follow one example. The Qur'an asks to be read with care and tested (4:82). It names Muhammad (ﷺ) as God's (﷾) messenger to all people (7:158).
“Say: "If ye do love Allah, Follow me: Allah will love you and forgive you your sins: For Allah is Oft-Forgiving, Most Merciful."”
“Do they not consider the Qur'an (with care)? Had it been from other Than Allah, they would surely have found therein Much discrepancy.”
“Say: "O men! I am sent unto you all, as the Messenger of Allah, to Whom belongeth the dominion of the heavens and the earth: there is no god but He: it is He That giveth both life and death. So believe in Allah and His Messenger, the Unlettered Prophet, who believeth in Allah and His words: follow him that (so) ye may be guided."”
The replies, answered
Bhagavata Purana 10.33.26-31 — book 10, chapter 33, verses 26-31
After the rasa dance, King Parikshit asks the sage Shuka a question. The Lord descended to destroy irreligion and restore dharma, and he is its speaker, follower and guardian. How then could he act against it by touching other men's wives, and what was his purpose (vv. 26-28)? Shuka answers that an apparent breach of dharma does not harm the mighty, as fire consumes everything and stays pure (v. 29). One who is not mighty must never do the same, even in mind. If he does it out of folly he is destroyed, like anyone but Rudra (Shiva) who drank the poison from the ocean (v. 30). The words of the mighty are true, and a wise person follows what of their conduct agrees with their words (v. 31).
Cited for
The Bhagavata says the mighty are not stained, as fire is not. So Krishna did nothing wrong.
The response
This page does not call Krishna wicked. It asks whether he can be followed. The same verses answer that no one who is not mighty may copy these acts, even in thought (10.33.30). A life that must not be copied cannot be the example for living. The Qur'an offers one that can: "a beautiful pattern (of conduct)" (33:21).
Where it lands — Even on the Bhagavata's own answer, these deeds are not for anyone to follow.
Bhagavata Purana 10.33.37-39 — book 10, chapter 33, verses 37-39
The chapter goes on. The cowherd men, bewildered by the Lord's power of illusion, thought their wives were at home beside them, and so felt no jealousy towards him (v. 37). Krishna then told the gopis to go home, and they obeyed though they did not wish to leave (v. 38). Whoever hears or tells these pastimes with faith, the chapter says, gains pure devotion to the Lord and soon conquers lust, the disease of the heart (v. 39).
Cited for
These are spiritual pastimes. Hearing them with faith cures lust, so they purify the heart.
The response
Then the Bhagavata offers them as a picture of devotion, and it says plainly not to imitate them. In Islam, love of God (﷾) is shown by following His messenger (3:31). His words and deeds agree: his character was the Qur'an (Muslim 746).
Where it lands — A story told for devotion but not for imitation does not give a pattern for life.
Bhagavata Purana 5.19.5 — book 5, chapter 19, verse 5
In a hymn to Rama sung by his devotee Hanuman, the Bhagavata says that the Lord's descent as a mortal was not only to kill the Rakshasa, but also to teach mankind. Otherwise, it asks, why should sorrow fall to the lot of him who is the soul of the universe? Three verses later (5.19.8), it calls on everyone, celestial, Asura, man or monkey, to worship Hari in the human form of Rama.
Cited for
Hindus follow Rama for conduct. Krishna is for devotion.
The response
Then the follower needs two divine lives, one for conduct and one for love. In the Gita, though, Krishna says people copy what the great man does (3:21). In Islam, one messenger shows both: "If ye do love Allah, Follow me" (3:31).
Where it lands — Islam joins love of God (﷾) and the pattern for life in one messenger.
Qur'an 33:50 — Surat al-Ahzab (The Clans), verse 50
“O Prophet! We have made lawful to thee thy wives to whom thou hast paid their dowers; and those whom thy right hand possesses out of the prisoners of war whom Allah has assigned to thee; and daughters of thy paternal uncles and aunts, and daughters of thy maternal uncles and aunts, who migrated (from Makka) with thee; and any believing woman who dedicates her soul to the Prophet if the Prophet wishes to wed her;- this only for thee, and not for the Believers (at large); We know what We have appointed for them as to their wives and the captives whom their right hands possess;- in order that there should be no difficulty for thee. And Allah is Oft-Forgiving, Most Merciful.”
Cited for
Your prophet had rules for himself alone too (33:50).
The response
Yes, a few rulings were for him alone, and each is named, by the Qur'an or by him. They are lawful for him by God's (﷾) own word, in matters such as marriage or extra night prayer (33:50; 17:79). None is a breach of God's (﷾) law excused by power. In all else the Qur'an tells believers to follow him (59:7), and calls him a beautiful pattern (33:21).
Where it lands — Rulings that God's (﷾) word makes lawful for one man are not the same as a breach of dharma excused by power.
Perspectives
The Lord's play is beyond our rules
Krishna is the Lord, and his deeds are lila, divine play, not acts bound by human rules. The Bhagavata itself says that the mighty are not stained, as fire is not. The rasa dance shows the soul's pure love for God, and hearing it with faith frees the heart from lust.
The Bhagavata Purana and the Vaishnava traditions that follow it
The mighty are not stained by what looks like a breach of dharma. Fire burns everything and stays pure (Bhagavata 10.33.29).
Rebuttal
Then these deeds are not an example. The same passage says that no one who is not mighty may copy them, even in thought (10.33.30). The Qur'an gives a messenger to follow in all things (33:21).
The rasa dance is the soul's pure love for God. The Bhagavata says that whoever hears it with faith conquers lust, the disease of the heart (10.33.39).
Rebuttal
Then the chapter is offered as a picture of devotion, not a pattern for conduct, and the Bhagavata says so by forbidding imitation. The Qur'an joins love of God (﷾) to following His messenger (3:31).
In the Gita, Krishna speaks of his duty to act, not of his play (lila) in Vrindavan. The two are different kinds of deeds.
Rebuttal
That is the sorting this page describes: some of Krishna's deeds are a pattern, and some must never be copied. In Islam the messenger's life is not divided this way (33:21).
No law was broken: the cowherds felt no jealousy, for each thought his wife was at home beside him (10.33.37).
Rebuttal
King Parikshit's question shows that the text itself saw a difficulty. Its answer is not that nothing happened. It is that the mighty are not stained, and that others must not copy them (10.33.29-30).
Rama for conduct, Krishna for devotion
Hindus do not take every deed of Krishna as a pattern. Rama, the ideal man, shows how to live; Krishna draws the heart to God.
A common Hindu view: Rama is called maryada purushottam, the ideal man of dharma
The Bhagavata says the Lord came as the mortal Rama to teach mankind (5.19.5). So Rama, not Krishna's play, is the model for conduct.
Rebuttal
Then the follower needs one divine life for conduct and another for love. Yet in the Gita, Krishna says that people copy what the great man does (3:21). In Islam, the messenger who teaches love of God (﷾) is also the pattern (3:31; 33:21).
Islam is no different
Islam too has rules for its prophet alone, and its God does things no one may copy.
A reply Hindus give to Muslims
The Qur'an gives Muhammad (ﷺ) a marriage rule "only for thee, and not for the Believers" (33:50). So Islam also has deeds of its prophet that others may not copy.
Rebuttal
Islam does have a few rulings for the Prophet (ﷺ) alone, and each is named, by the Qur'an or by him. They are lawful for him by God's (﷾) own word, in matters such as marriage or extra night prayer (33:50; 17:79). None is a breach of God's (﷾) law excused by power. In all else believers are told to follow him (59:7).
In Islam, God also does things no one may copy: He judges and He takes life.
Rebuttal
Islam never offers God (﷾) as a man walking among people to be copied. Nothing is like Him (42:11). He sends men as messengers to be followed, and He never commands what is shameful (7:28).
The Islamic perspective
God (﷾) guides through messengers who are men, so that their whole lives can be followed. The Prophet's (ﷺ) words and deeds agree, and God (﷾) never commands what is shameful. Love of God (﷾) is shown by following His messenger.
The Prophet (ﷺ) is a man like other men, to whom revelation came. The Qur'an calls him a beautiful pattern of conduct.
Believers are told to take what the Messenger gives and leave what he forbids, and his character was the Qur'an.
Allah (﷾) never commands what is shameful, and nothing is like Him.
Love of God (﷾) is shown by following His messenger, and the Qur'an asks every reader to test it.