So you've submitted the application...
The examination process is very similar in most countries. This is what happens to EU trademark application after it is submitted. First, and this is a special feature of EU trademarks, if the application is met with certain criteria, it will be examined really fast, typically in less than a week. You can read more about "fast track" procedure here.
First, the office examining the application will examine some formal aspects. Because most trademark offices have electronic filing systems, the need for these formal checks is reduced because applications cannot be submitted unless certain information is included. Typically these formalities relate to issues such as payment of applicable government fees, checking that the information included is formally correct. For example, if the trademark application is for a logo, that the type of trademark identified is not a "word trademark", or that the applicant's name is entered correctly. This formalities have a larger role in non-electronic applications. For example, in a non-electronic application the office would require that the application is signed by the applicant.
Next, the trademark office typically inspects that the goods and services are identified correctly in the application. There's two aspects of this. First, they will check that the items are written with required clarity and specificity. There are some differences between different trademark offices. For example, the EU trademark office accepts "computer software" as such, whereas the US office requires that it is more specified, such as "music-composition software". Secondly, the trademark office checks that the items are placed under correct class numbers.
After classification, the trademark office examines whether there are any reasons why a trademark should not be accepted. There are two main aspects of this. All offices examine whether the trademark is "distinctive" enough to be accepted for registration. In short, trademarks that are generic terms or describe the goods and services are considered "devoid of distinctive character" and not accepted as trademarks. You can read more about that here. In addition to distinctiveness, some offices also examine whether there are any prior registrations that prevent the registration of the applied mark. For a prior registration to form an obstacle, the trademarks must be similar and they must cover similar goods and services. The EU trademark office does not examine prior registrations and consider them obstacles, it is only if the prior trademark's owner makes an "opposition" against registration that the similarity of prior trademark will be assessed. Depending on the country, the following prior rights can prevent the registration of a trademark:
Distinctiveness and prior rights are the most typical reasons for trademark applications to be rejected. There are other grounds as well (for example the trademark is against public morality or somehow misleading), but they rarely are an issue.
Office actions (notifications)
If the examining trademark office considers there to be a problem with classification or other grounds why they object to the trademark being accepted (for example, lack of disticntiveness or prior rights forming an obstacle for registration), they will issue something called (in most countries) "office action". These office actions detail what needs to be corrected or changed (in case of classification) or why the trademark cannot be accepted (in case of lack of distinctiveness or prior rights). The trademark office will not reject the application without giving the applicant a chance to address the issues identified in the office actions. It is common that the issues can be easily remedied. Sometimes legal argumentation is required to overcome problems of substance.
There is one really important aspect of office actions that companies often neglect. Even if the objections are partial (for example registration can be granted for certain goods and services identified in the application), in many countries it is required that a response is submitted even if the application is on the way to be accepted to satisfactory degree. If no response is submitted, many trademark offices consider the application abandoned and will not register the trademark even for those goods for which no obstacles for registrations were found. It is therefore important to respond to office actions even if it seems unnecessary.
Some trademark offices can give several office actions regarding the same matter, others give only one office action and then decide the case taking into considerations and arguments the applicant has put forward.
In almost every country it is possible to appeal against the decision of the trademark office. So even if the office rejects the application, it is possible to have the decision reviewed by an appeal body.
That's broadly what happens in most countries.