Yes, you can lose a trademark, and in more ways than one.
First, you can be denied registration in the first place. Once you apply for a trademark application, it might be refused by the respective IP office if it does not meet the criteria for a successful registration. For example, your mark might be too generic, descriptive, or identical to an existing trademark. However, for each of these options, there might be some edge cases in which you can file an appeal with the trademark board and successfully register your trademark.
Second, you can lose your trademark even if you manage to register it. If you do not keep your registration alive by providing maintenance documents, your trademark will get an abandoned status. In the majority of jurisdictions, this happens if you fail to renew your trademark after ten years. In the US, you also have to provide supporting documents proving your trademark is active on the US market between the 5th an the 6th years of use.
Third, if you do not use your trademark in commerce, a 3rd party can file a petition for cancellation, meaning you can't simply hold the trademark without using it. However, in this case, the burden of proof is on them, and they must be able to prove that your trademark wasn't used in a given market for a specific period of time, usually five years.