You can’t do it for every function. For example $e^x$ grows too fast at infinity to have a Fourier transform (even in the very general distributional sense).
Consider the mapping $\iota:L^1_{\text{loc}}(\Bbb{R}^n)\to\mathcal{D}’(\Bbb{R}^n)$ mapping each locally-integrable function $f$ into its associated distribution ($\phi\mapsto \int_{\Bbb{R}^n}f\phi$). Now, you know that the $\mathcal{D}(\Bbb{R}^n)\subset \mathcal{S}(\Bbb{R}^n)$ so taking duals reverses the inclusions, $\mathcal{S}’(\Bbb{R}^n)\subset \mathcal{D}’(\Bbb{R}^n)$, i.e every tempered distribution can naturally be thought of as a distribution. So, you can now consider the preimage $\mathcal{T}(\Bbb{R}^n):=\iota^{-1}[\mathcal{S}’(\Bbb{R}^n)]$ which is a subspace of $L^1_{\text{loc}}(\Bbb{R}^n)$, and is called the space of tempered functions. In words it just means those $L^1_{\text{loc}}$ functions whose induced distributions actually lie in the subspace of tempered distributions. This space consists of very many functions, including those that have polynomial growth in an integrated sense (as mentioned in the comments).
So, now you can certainly apply the Fourier transform. More precisely, consider the composition
\begin{align} \mathcal{T}(\Bbb{R}^n)\xrightarrow{\iota} \mathcal{S}’(\Bbb{R}^n)\xrightarrow{\mathscr{F}}\mathcal{S}’(\Bbb{R}^n), \end{align} taking a tempered function to its naturally induced tempered distribution, and then taking its Fourier transform, which thus lands you in the space of tempered distributions.