It must be rough to start out at a new job like that. I know that I always want to put my best foot forward for the first several months. I feel like first impressions are what get remembered! But then sometimes there is no avoiding health issues. My cousin was at a training across country for a new job (the company shipped all newbies to the same site probably to save on costs) when she was rushed to the ER. It was almost a week before she was stable enough to be transported home. But even then she missed lots of work for treatments. She also started to feel unwanted in the office due to all her missed days and complications.
Ultimately you must do what is best for you and your family. If it was me, I would likely verify that my missed days did not negate the training. If they didn't, I would find help to get through the next 4 weeks. Your health is important and you need to do what you can to preserve it. The training sounds intense, and it really sounds like you need at least a few days to focus only on the training and sleeping. You can offer a favor back after the training when you have more time.
You can show the company how diligent you are by reminding them that this job is so important to you that you are not giving up and will complete the training. Be positive and sound confident. Stop feeling guilty.
Also, unless the training is graded the company would be foolish to dump you. A friend of mine who is a lawyer said that her practice advises companies not to touch pregnant employees. She says the law is on the side of pregnant women and the elderly such that very few loose their case. Unless the company states up front something like "You must attend 37 of the 40 days of training" or "You must maintain a grade of ...." it will probably be hard for them if you pursue legal action. However, it will probably also be hard for you (time, energy, and monetarily), so clearly the best thing would be to make a decision about the program, get help to make it through, and convince the company that you are invested in them.