The following draws halos around simple paths as the one above. You only need to record the path
\draw[thick,postaction={record path={step=5pt}}] (1,1) -- (2,2) -- (2,3.5);
and then can draw a halo via
\draw[dashed,halo];

\documentclass[tikz,border=3.14mm]{standalone}
\usetikzlibrary{decorations.markings}
\newcounter{halo}
\tikzset{record path/.style={/utils/exec=\tikzset{halo pars/.cd,#1},
decorate,decoration={markings,mark=at position 0 with
{\setcounter{halo}{1}%\typeout{\pgfdecoratedpathlength}
\path (0pt,{\pgfkeysvalueof{/tikz/halo pars/dist}}) coordinate (halo-L-\number\value{halo})
(0pt,{-1*\pgfkeysvalueof{/tikz/halo pars/dist}}) coordinate (halo-R-\number\value{halo})
({-\pgfkeysvalueof{/tikz/halo pars/dist}/sqrt(2)},{-\pgfkeysvalueof{/tikz/halo pars/dist}/sqrt(2)}) coordinate (halo-A-1)
({-\pgfkeysvalueof{/tikz/halo pars/dist}},{0pt}) coordinate (halo-A-2)
({-\pgfkeysvalueof{/tikz/halo pars/dist}/sqrt(2)},{\pgfkeysvalueof{/tikz/halo pars/dist}/sqrt(2)}) coordinate (halo-A-3);
\pgfmathsetmacro{\mystep}{(\pgfdecoratedpathlength-2*\pgfkeysvalueof{/tikz/halo pars/step})/int(1+(\pgfdecoratedpathlength-2*\pgfkeysvalueof{/tikz/halo pars/step})/\pgfkeysvalueof{/tikz/halo pars/step})}
\xdef\mystep{\mystep}},
mark=between positions \pgfkeysvalueof{/tikz/halo pars/step} and {\pgfdecoratedpathlength-\pgfkeysvalueof{/tikz/halo pars/step}} step \mystep pt with {\stepcounter{halo}
\path (0pt,{\pgfkeysvalueof{/tikz/halo pars/dist}}) coordinate (halo-L-\number\value{halo})
(0pt,{-1*\pgfkeysvalueof{/tikz/halo pars/dist}}) coordinate (halo-R-\number\value{halo});},
mark=at position 1 with {\stepcounter{halo}
\path (0pt,{\pgfkeysvalueof{/tikz/halo pars/dist}}) coordinate (halo-L-\number\value{halo})
(0pt,{-1*\pgfkeysvalueof{/tikz/halo pars/dist}}) coordinate (halo-R-\number\value{halo})
({\pgfkeysvalueof{/tikz/halo pars/dist}/sqrt(2)},{\pgfkeysvalueof{/tikz/halo pars/dist}/sqrt(2)}) coordinate (halo-B-1)
({\pgfkeysvalueof{/tikz/halo pars/dist}},{0pt}) coordinate (halo-B-2)
({\pgfkeysvalueof{/tikz/halo pars/dist}/sqrt(2)},{-\pgfkeysvalueof{/tikz/halo pars/dist}/sqrt(2)}) coordinate (halo-B-3);
\xdef\LstHaloCoords{(halo-A-1) (halo-A-2) (halo-A-3)}
\foreach \XX in {1,...,\number\value{halo}}
{\xdef\LstHaloCoords{\LstHaloCoords\space (halo-L-\XX)}}
\xdef\LstHaloCoords{\LstHaloCoords\space (halo-B-1) (halo-B-2) (halo-B-3)}
\foreach \XX in {\number\value{halo},\the\numexpr\number\value{halo}-1,...,1}
{\xdef\LstHaloCoords{\LstHaloCoords\space (halo-R-\XX)}}
}}},
halo/.style={insert path={plot[smooth,samples at={1,...,\number\value{bracep}},variable=\x]
(bracep-\x)}},halo/.style={insert path={plot[smooth cycle] coordinates {\LstHaloCoords} }},
halo pars/.cd,dist/.initial=5pt,step/.initial=2pt}
\begin{document}
\begin{tikzpicture}
\draw[thick,postaction={record path={step=5pt}}] (1,1) -- (2,2) -- (2,3.5);
\draw[dashed,halo];
\end{tikzpicture}
\end{document}
The halo path is known to TikZ so it can be used for all sorts of things like intersections or fill with pattern (needs the libraries intersections or patterns), e.g.
\draw[thick,postaction={record path={step=5pt}}] (1,1) -- (2,2) -- (2,3.5);
\draw[red,pattern=north west lines,pattern color=blue,halo];

As you can see, the result is not perfect, but can be improved by playing with the step parameter (I chose this on purpose in order not to deceive users). An automatically nice solution that works with much more complicated, in particular self-intersecting, paths is much harder to obtain. However, the above works with curves, too, i.e. not just with straight lines.
Note also that if I only take your dashed contour, add rounded corners and replace the last coordinate by cycle (so that the last corner is also rounded), I get

\documentclass[tikz,border=3.14mm]{standalone}
\begin{document}
\begin{tikzpicture}
\draw [thick] (1,1) -- (2,2);
\draw [thick] (2,2) -- (2,3.5);
\draw [dashed,rounded corners] (2.2,2) -- (2.2,3.7) -- (1.8,3.7) -- (1.8,2) --
(0.8,1) -- (1.1,0.8) -- cycle;
\end{tikzpicture}
\end{document}
Things look arguably even better if one draws the fist line in one stretch and takes into account the slope of the lower leg when drawing the contour.
\documentclass[tikz,border=3.14mm]{standalone}
\begin{document}
\begin{tikzpicture}
\draw [thick] (1,1) -- (2,2) -- (2,3.5);
\draw [dashed,rounded corners] (2.2,1.9) -- (2.2,3.7) -- (1.8,3.7) -- (1.8,2.1) --
(0.8,1) -- (1.1,0.8) -- cycle;
\end{tikzpicture}
\end{document}

If you want the dash pattern to close, use
\documentclass[tikz,border=3.14mm]{standalone}
\usetikzlibrary{decorations.markings}
\begin{document}
\begin{tikzpicture}
\draw [thick] (1,1) -- (2,2) -- (2,3.5);
\path [rounded corners,preaction={decorate,decoration={markings,mark=at position 0 with {%
\pgfmathsetmacro{\myon}{\pgfdecoratedpathlength/50}
\xdef\myon{\myon}}}},postaction={draw,dash pattern=on \myon pt off \myon pt}] (2.2,1.9) -- (2.2,3.7) -- (1.8,3.7) -- (1.8,2.1) --
(0.8,1) -- (1.1,0.8) -- cycle;
\end{tikzpicture}
\end{document}

just-do-it-for-mesite. – Raaja_is_at_topanswers.xyz Jun 10 '19 at 07:23