-- For $K=O(n)$ (or $U(n)$). Do someting similar by making $G$ act on the set of positive definite symmetric (hermitian) matrices via $(X,A)\mapsto XA{\bar X}^{t}$.

In general, for a non-archimedean base field, you can make $G$ act on the extended Bruhat-Tits building, but the answer is going to be technical according to whether $G$ has a center or not, is simply connected or not. Over archimedean fields, I guess you have to use symmetric spaces.

$SO(n)$ is not only maximal compact in $SL_n(\mathbb{R})$, it is even a maximal subgroup! Same for $SU(n)$ in $SL_n(\mathbb{C})$. This follows e.g. from Exercise A.3 in Chapter VI in S. Helgason, ``Differential geometry, Lie groups and symmetric spaces'', Academic Press, 1978. From this the normalizers of $O(n)$ in $GL_n(\mathbb{R})$, and of $U(n)$ in $GL_n(\mathbb{C})$, are easily determined.

To establish maximality of $K=SL_n(\mathbb{Z}_p)$ as a subgroup of $G=SL_n(\mathbb{Q}_p)$, there is a cute argument using the Howe-Moore theorem, telling you that, if $\pi$ is a unitary representation of $G$ without non-zero fixed vectors, then all coefficients of $\pi$ go to $0$ at infinity on $G$. So assume that $U$ is a proper subgroup of $G$, containing $K$. Since $K$ is open, $U$ is open too. By simplicity of $G$, the subgroup $U$ cannot have finite index. Let $\pi$ be the quasi-regular representation of $G$ on $\ell^2(G/U)$, it has no non-zero fixed vector; let $\delta_U\in\ell^2(G/U)$ be the characteristic function of the base-point of $G/U$, corresponding to the trivial coset of $U$. Then the coefficient $g\mapsto<\pi(g)\delta_U|\delta_U>$ is constant and equal to 1 on $U$, so by Howe-Moore $U$ must be compact. Since $K$ is maximal compact, we have $U=K$.
From this you also deduce the normalizer of $GL_n(\mathbb{Z}_p)$ in $GL_n(\mathbb{Q}_p)$.