There's a joke in the aero world that F-16s are designed by people Ph.D.'s, manufactured by people with Masters degrees, flown by people with a Batchelor's degree in History and maintained by people with a High School Diploma.
It turns out you have to make jobs for people at all levels of education and experience.
But in reality they do significant amounts of directed research using "burden" funded research for their on internal needs, and grant work for NASA and other agencies (like DOE).
I worked at JPL, and worked with folks at Ames for various reasons. Both centers try to carve out enough internal time to research new mission concepts, new ways of accomplishing existing mission concepts, or new basic technologies that have dual use for missions/commercial appliations. All of this would qualify as basic research similar to what would happen at Caltech or Stanford, the nearby official/unofficial partners.
I attended all kinds of conferences and agency-level meetings with researchers from many other agencies / nasa centers as well, all mostly aimed at finding out how to better explore space (new missions), or improve our existing exploration capabilities, either with new or by adapting existing tech.
NASA has an entire reporting pipeline called "New Technology Reports" that makes all of this research immediately public, and a deep tradition of spinning off commercial businesses to carry it forward if it turns out to be a good idea.