Southwark Crown Court heard she was raped by Sgt Edwin Mee at the Mitcham Barracks Army Careers and Information Office in Croydon.
She said when she told him about the pregnancy he said: "Oh, I did not think you would get pregnant." She later miscarried.
Mr Mee, 45, of Tavistock Road, Croydon, denies a string of sex assaults.
Mr Mee is charged with 17 counts of sexual assault, three rapes and one count of assault by penetration against 11 victims between 2010 and 2011.
The woman, aged 27, broke down as she told the jury how she was raped, later miscarried and felt she had no-one to turn to about her ordeal.
Speaking from behind a curtain, she said Mr Mee made her feel "uncomfortable" during the recruitment process but she felt she had to attend his appointments because she wanted a job in the Army.
She only later became able to say what had happened once an investigation was launched and she later got married, the jury heard.
Her husband found out about the alleged rape through a family friend and "told me not to be scared, he gave me the courage to come here today," she said.
On the night of the alleged rape, she was nervous after Mr Mee had organised an evening appointment and told her he "liked her".
She told the jury: "He said 'there is no other way out. The front door is locked. There is no camera in here and this door is closed - so you have to choose. You have to give me sex. If you do not want to do it then you cannot leave. You have to choose and then you cannot say anything to anyone."
The woman said she did not feel as if she could escape: "Everywhere was closed... I tried and tried to get to the main door but he said 'that door is already locked'."
After the alleged assault, she said, he took her out the back door and dropped her off in his car so she could catch the bus home.
The trial continues.

The six-year-old victor, ridden by Noel Fehily, was cut to about 16-1 from 66-1 for the Cheltenham Gold Cup in March.
Alary, trained by Colin Tizzard, had been considered a Gold Cup hope but was pulled up before the third last fence.
Bristol De Mai sealed a Haydock double for Nigel Twiston-Davies after The New One became the first horse to win the Champion Hurdle Trial three times.
The nine-year-old, ridden by Sam Twiston-Davies for his trainer father, produced a gutsy display to edge past runner-up Clyne.
Unbeaten Neon Wolf ran out a nine-length victor of the novices' hurdle, while 2014 Champion Hurdle winner Jezki returned from a 632-day absence with a comfortable success at Navan.
Earlier, Ascot's Grade One meeting and Taunton's card on Saturday were called off because of frozen ground.
The Ascot fixture was due to feature the Clarence House Chase, which has been rescheduled to take place at Cheltenham on Festival Trials Day on 28 January.
Cheltenham will now have a nine-race card next week, with racing starting at midday.
Cornelius Lysaght, BBC horse racing correspondent
Abandoned Ascot was billed as the day's top fixture, but had it been on, it'd have struggled to compete for interest with Haydock in terms of the build-up to March's Cheltenham Festival.
The Nigel Twiston-Davies-trained pair The New One and Bristol De Mai showed off the fact they are players - not necessarily the biggest - but definitely players in whatever they go for at Cheltenham.
But the horse to really catch the eye was the Harry Fry-trained Neon Wolf who breezed home under jockey Noel Fehily (2-05) and will line-up in one of the Festival's big novice hurdles.
A woman has told a court she became pregnant after an Army recruitment sergeant raped her in a locked room.
[NEXT_CONCEPT]
Bristol De Mai romped home to win the Peter Marsh Chase at Haydock as the well-touted Alary disappointed.