\documentclass{book}
\usepackage{amsmath,amsthm}
\newtheorem{theorem}{Theorem}
\numberwithin{theorem}{chapter}
\makeatletter
\let\c@equation\c@theorem
\makeatother
\begin{document}
\chapter{Example}
\section{Example}
\begin{equation}
1+2=4
\end{equation}
\begin{theorem}
This is a theorem
\end{theorem}
\begin{equation}
1+2=3
\end{equation}
\end{document}