\documentclass{article}
\usepackage{amsmath,amsthm}
%\numberwithin{equation}{section}
\usepackage{xepersian}
\settextfont[Scale=1.1]{Persian Modern}

\theoremstyle{definition}
\newtheorem{definition}{تعریف}[section]
\theoremstyle{definition}
\newtheorem{theorem}[definition]{قضیه}
\newtheorem{lemma}[definition]{لم}
\newtheorem{proposition}[definition]{گزاره}
\newtheorem{corollary}[definition]{نتیجه}
\newtheorem{remark}[definition]{ملاحظه}
\theoremstyle{definition}
\newtheorem{example}[definition]{مثال}
%\newtheorem{theorem}{Theorem}
%\theoremstyle{definition}
%\newtheorem{theorem}[definition]{قضیه}
\makeatletter
\let\c@equation\c@definition
\let\theequation\thedefinition
\makeatother

%\numberwithin

\begin{document}
بله حالا
\section{آزمایش}
\begin{equation}
1+2=4
\end{equation}
\begin{theorem}
This is a theorem
\end{theorem}
\begin{equation}
1+2=3
\end{equation}
\end{document}