If a person has enemies and wants to take revenge, then can he meditate? Will those thoughts stop the person from meditating even if he doesn't think those things while meditating?
If a person has enemy's and wants to take vengance, than can he do meditation?
Of course he can. Insight meditation is the only way to permanently uproot the causes for those thoughts, i.e. the root defilement of hatred and namely Ignorance (avijja).
Will such thoughts never let the person do meditation even if he don't thinks such things while meditating?
All formations are impermanent so its not possible for something to "never let" anyone do something. That's an extreme view.
It might be more challenging to do meditation while the hindrances are present. But it is necessary. One can only purify the mind by dealing with the hindrances. It just means that there is work to be done.
Loving-kindness meditation is a great way of over coming thoughts of hatred, vengeance and the like. See my answer here for a detailed description on how to practice Metta meditation.
If you have harmful thoughts Metta meditation is the antidote for such thoughts. It might be difficult to do but this will help in alleviating such thoughts.
If negative thoughts arise they also can be displaced using the following method:
(1) Thought displacement - turn his attention to a different sign connected with the wholesome.
(2) Aversion therapy - should examine the disadvantage [the danger] of those thoughts
(3) Non-attention - he should not mind them, he should disregard them
(4) Thought reduction - should attend to the stilling of the thought-formation
(5) The last resort: Sustained effort - with clenched teeth and the tongue pressing on the palate, he should subdue, restrain, attack the (bad) mind with the (good) mind
Adopted from: Vitakka Saṇṭhāna Sutta
One objective of Metta is breaking down the mental classification you have towards individual beings or classes of them into groups which you deem favorable, unfavorable or neutral and reacting to them with pleasant, unpleasant and neutral feeling associated with each classification. One such classification systems would be me, beings I like, neutral or unknown beings and being you do not like. When you break down the classification you will like everyone like yourself. Another classification could be same country, neutral country and enemy country. When you break down the mental classification system you will love everyone as your fellow country men. Another classification could be higher life forms, lower life forms and same level life forms. When you break down this classification you will love all living beings equally.
When you classify if a being is from a favorable category you react with pleasant sensation, unfavorable category with unpleasant sensation and neutral category with unpleasant sensations. These sensation lead to the unwholesome roots of craving for the favorable and pleasant, aversion towards the unfavorable and unpleasant and ignorance towards the neutral, as discussed in the Pahāna Sutta. When such reaction stops you stop creating negative mental states and come out of misery.
In order to develop Metta you should wish every one in every category you can imagine to be well and happy. Also know how the classifications are woulding in the back of your mind and know mental reaction and sensation. Say you remember and foe look at the mental reaction and sensations that follow. If you remember a loved one see the mental reaction and the sensations that follows. Try to be equanimous knowing the changes and and arising and passing nature of the sensations.
Once the favorable and unfavorable categorisations are broken you do not despair if you meet with non loved one and with equanimity you do not get attached to others. Beings cannot cause you stress. You are free from negative thoughts about other and also this itself can take you to the final goal of Nirvana.