I signed a contract with a company I found quite interesting, however, another company I had applied to earlier finally responded. I prefer the latter. The contract I have signed states that both employer and employee can terminate the contract within the first month without giving a reason. If I decide to go with the second company, which seems to be the thing I will do, should I already inform the first company that I am 'breaking' the contract, or should I wait until the first day and resign then? The contract does not stipulate anything about breaking it before it even begins. Or should I instead ask the HR department of the first company what they would prefer and what the procedure is?
If you are certain that you are going to quit, tell the first company immediately. It is annoying when a candidate backs out after accepting a position. If you let them know immediately, you can mitigate that annoyance by allowing them to potentially offer the job to their second-choice candidate before that candidate accepts a different position. And you save them the expense of doing all your on-boarding paperwork only to quit on the first day.
You should definitly notify them as soon as possible. They probably won't like it, but the longer you wait, the worse it will get, especially if they find out you knew about it way before you told them. And as Justin Cave said in his answer, notifying them ASAP will also allow them to reach out to the other applicants still, instead of having to start all over again.
While the other answers are coming from the employer's perspective, this will be answer from the employee's perspective.
Ethically, you should inform the first company as soon as possible about your quitting, but you should only do that after you get your employment confirmation (i.e., signing an employment contract) from the second company.
While it is bad to break a promise (or in this case, a contract), your focus should be on finding the best possible fit for your own career advancement. Remember, the company can choose from tens/hundreds of candidates, while you can only choose from one or two opportunities. They may be wasting some resources, but you are wasting your future.
Depending on where you are from or the terms of the contract, the company may sue you for breaking the contract, but practically that won't be done because it's not worth the resources just to screw you up for such a trivial issue. Besides, the contract stated that you can quit within one month from commencement without reason. They are prepared to lose you.
When rejecting the first company, be nice and nicely apologise. Most of the time, the HR is already used to this kind of situations. Even if they don't response positively, just remember that they have every right to.
You mentioned the contract states you can terminate the contract without reason within the first month. They are effectively saying you can cancel the contract anytime as long as it's before the second month since commencement.
If you're worry because the contract did not say anything about cancelling before commencement, don't worry about it because it doesn't make sense that you cannot cancel until you start. So feel comfortable to just tell them.
If they do have a problem with you cancelling before you starting, then just terminate it on your first day.