Frank and Mary Finlay bought Molly in November 2015 thinking she was female.
But they soon discovered she lifted her leg in an unusual way when going to the toilet and asked vets to investigate.
They found that Molly had male testicles, which had not descended, and female genitalia with a poorly-formed "vestigial" penis.
"Some folk would use the term intersex, some would say non-binary, in that she is not male or female, but the correct scientific term is that she is a male pseudohermaphrodite," says vet Ross Allan.
He operated on Molly when it became apparent that the anatomical differences were causing problems.
Mr Allan told BBC Scotland's Kaye Adams Programme:  "It is extremely rare.
"In the literature there have been about 15 cases published in total.
"In 15 years of doing this job I have seen this in Molly and in no other dog at all."
The Glasgow vet says his colleagues in the profession had not come across it either.
Mr Finlay told Kaye Adams: "When we got Molly we believed her to be a bitch.
"I noticed in the house she would squat to do her pees and outside she would lift her leg."
He mentioned it to the vet at Mr Allan's Pollokshaws surgery and they raised possibility of Molly being hermaphrodite.
Mr Finlay says: "They did scans and x-rays and eventually she was operated on in May 2016 at six months old."
The vet says they diagnosed Molly quite early but decided not to operate until the dog had grown.
He says: "We did x-rays to establish where Molly's urethra went - the tube from her bladder to the outside world - what route that took.
"What transpired was that although Molly looked to be female, her urethra followed the route as though she was a boy.
"She did not have a properly formed penis.
"She actually had the female external genitalia, as it were, but in the male formation.
"That was the problem. It was not normal anatomy and it was getting inflamed and so on."
The vet says that as time went on Molly "was starting to get interested in soft cushions" and behave more like a male dog.
"But not having the correct anatomy to do that, that was going to cause more problems as well," he said.
"The problem was that if we did not operate this would have exacerbated and got worse over time."
The surgery removed the "vestigial" penis and created a female opening in Molly's groin.
Mrs Finlay says: "It was a worry because it was big operation.
"She was only six months old. She was tiny. When we got her she was only 11in long and six inches high. There wasn't much of her."
Mrs Finlay says: "The surgery was quite nerve-wracking. My daughter Joy was saying 'don't worry mum everything's going to be fine'.
"I was up at night worrying and hoping.
"When she came home with us she was at the bottom of our bed, with her own blanket and she lay there crying."
There was a problem with haemorrhaging but Molly stayed with the vet for a number of days and made a full recovery.
"That was quite frightening but she came through it," says Mrs Finlay.
It has now been almost a year since Molly's operation.
Mrs Finlay says: "She is a fantastic wee dog, great with the grandchildren. Everyone that comes in gets their ears licked. She just runs at people and licks their ears."
Mr Allan says: "Molly is Molly and she is happy and fit and healthy, that is the main thing."
Molly is an "extremely unusual" dog, according to the vet who discovered the Jack Russell terrier puppy was an hermaphrodite.