Just define \1 with an argument:
\newcommand{\1}[1]{\mathbbm{1}_{#1}}
Full example
\documentclass{article}
\usepackage{bbm}
\newcommand{\1}[1]{\mathbbm{1}_{#1}}
\begin{document}
$\1{x_1=x_2}$
\end{document}

On the other hand, the package bbm only provides bitmap fonts; you can get a scalable Type1 font from bbold.
\documentclass{article}
\usepackage{amsmath}
\DeclareRobustCommand{\1}[1]{\text{\usefont{U}{bbold}{m}{n}1}_{#1}}
\begin{document}
$\1{x_1=x_2}$
\end{document}

I wouldn't recommend \usepackage{bbold}, because it clobbers the \mathbb font from amssymb (or amsfonts).
Let's stick to \newcommand. When you do it, you can specify a number of arguments:
\newcommand{\foo}[2]{...}
would mean \foo should be followed by two braced groups, the arguments, like
\foo{Abc}{def}
and, in the definition text, you refer to the first braced group with #1 and to the second one by #2. In our case
\newcommand{\1}[1]{\mathbbm{1}_{#1}}
we just have one argument. This tells TeX that, when it finds \1{X}, it has to replace it with
\mathbbm{1}_{X}
The second version, with \DeclareRobustCommand is the same; this has the feature that, when the command \1 is found in a section title, it's written out as such in the auxiliary file. Just a technical thing, nothing to really worry about; using \newcommand in the second solution would be as good.
\1{X}to become\mathbbm{1}_{X}? – egreg Nov 14 '15 at 16:52\newcommand\1{\mathbbm{1}_}– Mark Nov 14 '15 at 19:15\1_{x_1=x_2}. One extra character, but it is clearer in the source what is intended. – James K Nov 14 '15 at 22:36