Maybe, But Probably Not
This page on the NASA web site tells us a lot. Generally, NASA media is free to use, so they won't be getting any money from it:
NASA content - images, audio, video, and computer files used in the rendition of 3-dimensional models, such as texture maps and polygon data in any format - generally are not copyrighted. You may use this material for educational or informational purposes, including photo collections, textbooks, public exhibits, computer graphical simulations and Internet Web pages. This general permission extends to personal Web pages.
News outlets, schools, and text-book authors may use NASA content without needing explicit permission. NASA content used in a factual manner that does not imply endorsement may be used without needing explicit permission. NASA should be acknowledged as the source of the material. NASA occasionally uses copyrighted material by permission on its website. Those images will be marked copyright with the name of the copyright holder. NASA's use does not convey any rights to others to use the same material. Those wishing to use copyrighted material must contact the copyright holder directly.
Commercial projects that want to use NASA media, however, have different rules:
Feature film and fictional film projects
...
A formal agreement is often required when there is a need to lay out what is expected of both parties in terms of shoots, clearances, protection of NASA's appearance in a fictional storyline, etc. An agreement may also be needed when the parties plan for an on-going collaboration for education or outreach activities beyond routine appearances or interviews.
After providing a signed NASA Non-Disclosure Agreement, NASA reviews a script to assess participation in a project. In some cases, clearances for use of the NASA Insignia and other identifiers, footage, still imagery and other NASA assets; details of shoots; post assistance and when appropriate; outreach leading to release of the film; are also addressed.
NASA does provide publicly available film footage and imagery regardless of involvement in a particular production.
So the next question is whether these agreements are revenue-generating. Legally, they could be, but in practice, they probably aren't. Here are the types of agreements NASA may enter into: https://technology-larc.ndc.nasa.gov/partnership-info/space-act-agreement
If NASA enters into a reimbursable agreement with a production company, then they will generate some revenue from that agreement. However, this report suggests NASA may be too often entering into non-reimbursable agreements when it could be getting reimbursement.
Regarding the first comment:
I found the following listing in this very long list of active agreements in June 2017:
338 24469 The Hollywood Black Film Festival THE PRODUCTION OF NASA THEMED SCIENCE FICTION FILM CONCEPTS 1/23/2017 1/23/2022 Non-Reimbursable $8,700 GSFC SAA5-17-1-N24469
360 18326 New York Film Academy James Webb Space Telescope Visual Storytelling 10/27/2014 10/27/2017 Non-Reimbursable $1,000 GSFC SAA5-2014-3-N18326
381 22569 Twentieth Century Fox Hidden Figures, 20th Century Fox Film 3/11/2016 3/11/2021 Non-Reimbursable $5,000 HQ 22569
387 19963 IMAX SPACEWORKS LTD. THE FILMING OF “A Perfect Planet” (working title) 3/3/2014 3/3/2019 Non-Reimbursable ----- HQ
636 17011 Houston Cinema Arts Society HCAS Film Festival 2/23/2015 2/22/2019 Non-Reimbursable $216,433 JSC SAA-OA-14-17011
398 14450 Evans & Sutherland Computer Corporation Planetarium Full-Dome Video Agreement 11/20/2013 11/20/2018 Non-Reimbursable ----- HQ
832 24363 Gloucester High School Video Production 12/8/2016 12/8/2017 Non-Reimbursable $11,843 LaRC SAA1-24362, Annex 1
If you scroll to the right, you'll see that none of them are reimbursable, not even the feature film Hidden Figures by 20th Century Fox.