While it is possible for a completely dead or abandoned trademark (where it is not possible to revive the trademark in any way) to be registered by a third party once again, various factors can be used as claims to potentially prevent the trademark from being registered again. These include the usage of the trademark (even when a trademark is considered abandoned, the mark may actually be in use) and any ongoing legal proceedings which might include the rights over the trademark in question.
These factors are co-dependent on the country of registration. Also, the first-to-file basis of certain jurisdictions (e.g. EU, UK) also factors in. Here, the first person to lodge a trademark application will be prioritized legally, irrespective of prior use of the brand.
The best way to protect your brand is to be aware of its validity (in most cases trademark is valid for 10 years) and file a Trademark Renewal when needed. Also, in jurisdictions where you need to submit proof of usage, you should be aware of the requirement of using the trademark. The important thing to note here is that the trademark needs to be used exactly as it was registered.