I am trying to understand why modifying the right margin should change the position of a box of width equal to the paperwidth.
\documentclass{beamer}
%\setbeamersize{text margin right=0cm}
% Modifying the right margin makes the beamercolorbox move to the right althought the box still
% is of width paperwidth.
% The LINEND is moving as expected.
\setbeamercolor{bgcolor}{fg=black,bg=red}
\setbeamertemplate{frametitle}{\begin{beamercolorbox}[wd=\paperwidth]{bgcolor}Box\end{beamercolorbox}}
\begin{document}
\begin{frame}{Title}
LINESTART \hfill LINEEND
\end{frame}
\end{document}