No (if you mean what I think you mean by that statement). If you have more than one variable in play it's always a good idea to keep track of which variables the implied constant for each big-O depends on. In your example, the implied constant for the outer big-O depends on $k$, but the implied constant for the inner big-O doesn't, so it seems misleading to use notation which pretends they are the same. And if the implied constant grows fast enough, the final statement you want is false (if an unadormed big-O means it doesn't depend on any of the variables which appear on the LHS). Consider, as I said in my comment to Yuval Filmus, $g(k, n) = 2^k n^{\log k}, f(k) = \log k$. In addition to $f(k) = O(\log k)$ you need to know that the implied constant doesn't depend on $n$.
Edit: The above was nonsense. Actually you are fine. You have a constant $C_1$ such that $f(k) \le C_1 \log k$ and another constant $C_2$ such that $g(k) \le C_2 n^{f(k)}$, hence $g(k) \le C_2 n^{C_1 \log k}$, or as Yuval Filmus points out, $g(k) = n^{O(\log k)}$.