What should I use to fill a gap between oak trim and wall?
You are exactly right, I use latex caulk to fill the gaps and then paint when dry.  This will create a seamless appearance.  I've seen homes where the owners have caulked all their trim and it looks fantastic -- very clean.

Edit for clarity: I always strike off the bead square (which I make sure gets pushed down into the space) with a sharp cornered putty knife blade.