You can do it (but only for equations in any of the amsmath environments). But it is wrong, very wrong: you should think ahead before tweaking this way the cross reference mechanism. When you search for labels, you'll have no clue what each one refers to without first knowing what section the reference/label appears in.
\documentclass{article}
\usepackage{amsmath}
\usepackage{etoolbox}
\newcounter{dummysec}
\preto\section{\stepcounter{dummysec}}
\makeatletter
\def\label@in@display#1{%
\ifx\df@label\@empty\else
\@amsmath@err{Multiple \string\label's:
label '\df@label' will be lost}\@eha
\fi
\xdef\df@label{\thedummysec-\unexpanded{#1}}%
}
\renewcommand{\eqref}[1]{\textup{\tagform@{\ref{\thedummysec-#1}}}}
\makeatother
\begin{document}
\section*{first section}
Here is an equation
\begin{equation}\label{a1}
E=mc^2
\end{equation}
where \eqref{a1} obtained by ....
\section*{second section}
Here is another equation
\begin{equation}\label{a1}
a^2=b^2+c^2
\end{equation}
in \eqref{a1} we have ....
\end{document}

\label{}system is that it isn't hard numbered by hand, meaning you can sub things in, take bits out, move them all around and LaTeX keeps track of the numbering for you. Now if you decide to movea1somewhere else, LaTeX will still keep track of the numbering correctly for you, but you might well find your own source code mighty confusing when you start talking about\eqref{a1}five equations into your section! – Au101 Jun 24 '16 at 01:35LaTeXdoes only use the latest definition of a\label{a1}, i.e. overwritting it will only produce the last reference, not something in between -- and it will complain of course about multiply defined labels then. – Jun 24 '16 at 04:20