In an unusual warning, doctors have reported the case of a man who injected cocaine into his urethra to heighten sexual pleasure and then, through ''extravagant complications,'' suffered gangrene that led to the loss of both legs, nine fingers and his penis.

The authors of the report, three psychiatrists from New York Hospital said it was not clear how the unusual cocaine use led to the complications. The doctors, John C. Mahler, Samuel Perry and Bruce Sutton, described the case in a letter in the current issue of The Journal of the American Medical Association.

The use of cocaine in the belief that it enhances sexual pleasure has often been reported. Several experts on sexuality and on drug abuse said they had heard of people rubbing cocaine on genital organs or injecting it into the urethra, the tube that carries urine out of the body. But they said it did not appear to be a widespread practice. Undetected Infection Suggested

Cocaine use has been associated with a variety of medical problems including heart attack, stroke and death. But Dr. John Money, an expert in sexuality at Johns Hopkins Medical School in Baltimore, said it would be unusual for cocaine alone to produce the extreme complications. Dr. Money questioned whether some other factor, such as an impurity in the cocaine, might have been at fault.