Tikz fit inner sep seperate values for all 4 directions
You can add some points to fit around. For example, to get
use the code:
\documentclass[]{standalone}
\usepackage{tikz}
\usetikzlibrary{fit}
\begin{document}
\begin{tikzpicture}[every label/.style={text=gray},node distance=2cm]
\node[draw] (n1) {hello};
\node[right of=n1,draw] (n2) {hello2};
\coordinate[above left of=n1] (n1left);
\node[draw,fit=(n1) (n1left) (n2)] (t31) {};
\end{tikzpicture}
\end{document}
This comes with a key fit margins
that does what I think you want. You can use it as e.g. in
\node[draw,fit margins={left=3pt,right=12pt,bottom=3pt,top=8pt},fit=(n1) (n2)] (t31) {};
to obtain
\documentclass[tikz,border=3mm]{standalone}
\usetikzlibrary{fit,positioning}
\tikzset{fit margins/.style={/tikz/afit/.cd,#1,
/tikz/.cd,
inner xsep=\pgfkeysvalueof{/tikz/afit/left}+\pgfkeysvalueof{/tikz/afit/right},
inner ysep=\pgfkeysvalueof{/tikz/afit/top}+\pgfkeysvalueof{/tikz/afit/bottom},
xshift=-\pgfkeysvalueof{/tikz/afit/left}+\pgfkeysvalueof{/tikz/afit/right},
yshift=-\pgfkeysvalueof{/tikz/afit/bottom}+\pgfkeysvalueof{/tikz/afit/top}},
afit/.cd,left/.initial=2pt,right/.initial=2pt,bottom/.initial=2pt,top/.initial=2pt}
\begin{document}
\begin{tikzpicture}[]
\node[draw] (n1) {hello};
\node[right=of n1,draw] (n2) {hello2};
\node[draw,fit margins={left=3pt,right=12pt,bottom=3pt,top=8pt},fit=(n1) (n2)] (t31) {};
\end{tikzpicture}
\end{document}
I also employ the positioning
library for easier positioning.