You can set the category code of the underscore to 11 or 12 (letter/other) within the tikzpicture environment. This means you don't need to escape it. It also means that you cannot use _ for math subscript anymore, you can use \sb{} instead. Moreover it means that you need to use T1 font encoding otherwise LaTeX does not know how to map _ to an actual underscore character. Finally it is advised to choose a different font, because Computer Modern has a very low underscore (visibly below the baseline), and Latin Modern has a very wide underscore. In the MWE below I used Palatino.
If you set the catcode within the environment then the change is local so you can use the underscore as normal in the rest of your document.
MWE:
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{palatino}
\usepackage{tikz-uml}
\begin{document}
\begin{tikzpicture}
\catcode`_=12
\umlinterface[x=-2]{a}{}{}
\umlclass[x=2]{a_impl}{$a\sb{1\dots n}$}{}
\umlinherit{a_impl}{a}
\end{tikzpicture}
\end{document}
Result:

Sources: How to use arbitrary text as node name in tikz graph in a simple way?
Is it safe to set underscore to a non-active character?
Decrease length of underscore character in normal text (gender_gap)
tikz-umlis not part of a standard installation!? The only manual I can find is from 2016: https://perso.ensta-paris.fr/~kielbasi/tikzuml/var/files/doc/tikzumlmanual.pdf Under Installation, it says "Coming soon". To me it looks like a dead project. – hpekristiansen Jun 17 '21 at 15:11