All perfect praise be to Allah, The Lord of the Worlds. I testify that there is none worthy of worship except Allah, and that Muhammad is His slave and Messenger.
The use of an ointment that contains alcohol on the outside of the body is based on the ruling of treating with impurities on the outside of the body. This is a matter of disagreement among scholars; some of them disliked it, and some other scholars gave concession for it. Among the scholars who gave concession to seek treatment with impurities on the outside of the body for a need is Shaykh al-Islam Ibn Taymiyyah as he said:
“As for medication: by eating pork fat, it is not permissible. Otherwise, medication by smearing it, then washing it after that, then this depends on the permissibility of getting in contact with (or touching) impurity in other than prayer. There is a well-known dispute on this matter, and the correct view is that it is permissible for its necessity, as it is permissible for a man to perform Istinjaa' with his own hand and remove impurity with his own hand. Whatever is permitted for its necessity, it is permissible to be treated by it, as it is permissible to be treated by wearing silk, according to the more correct of the two opinions.” [End of quote]
Therefore, if you know this (what is mentioned above), if it is possible to avoid using ointment containing alcohol and treat yourself with something else, then this is better in order to avoid the difference of opinion. Otherwise, the matter is easy – Allah willing – and it is possible to act upon the opinion of the scholars who consider that it is permissible to be treated with impurities. Moreover, if you use what contains alcohol, then it is more prudent to wash what has touched your body or clothes of it before praying.
Allah knows best.