It is certainly not harmful to BF while pregnant. True oxytocin is realease during nursing, and this hormone also causes uterine contractions but it is not going to put you into labor. If you are at a high risk of miscarraige or have risk of preterm labor, that would be different, but for the average person it is fine. Oxytocin is also released during orgasm, so if your doctors logic was true then a woman should never have an orgasm during preganancy either!
forgot to add my own experience.
I BF my child until I was 4 months pregnant, when he self weaned. He was 20 months old. I had progressively worse nipple pain as the pregnancy went on, to the point when I could not nursing him without curling my toes! I could hardly stand it and it was at that point he weaned. I was happy but also sad that it was over, a week later I was over it.
He started to bite me (and my mom a few itmes) and press on me close to when I delivered, I think he could smell colostrum, and he was very jealous of him brother BF. The first time he saw that he tryed to pull him off of me. I didn't want to tandem nurse, but I am sure he would have resumed BF if I had let him. I do regret not letting him now as think the jealousy woiuld have been much less if I had.
I didn't want to tandem nurse because my first ate all the time, every 1.5 to 2 hours day and night for the first 6 weeks straight, and continued to feed every few hours until he was 1 and I stopped that by going back to work. I thought I could never manage that again, and nurse a 2 year old! But the second baby was entirely differnt, he was bigger from the start, and he never ate so often like that, so it would have been managable.