Legally, if you merely mention series names and if you write your own fairly-general descriptions of spaceships (eg, “the ship was an overgrown pancake, with giant tailfins grafted on”) then it will be adequate to offer the usual disclaimers that “X is a registered trademark of Y” and “This work is not a product of or affiliated with P, Q, R”. Here are two examples of disclaimers:
Star Wars is a registered trademark of Lucasfilm Ltd. The LucasArts logo is a registered trademark of LucasArts Entertainment Company. LucasArts is a trademark of LucasArts Entertainment Company. (starwarsmush.com)
Disclaimer: This site is in no way sponsored or endorsed by George Lucas, Lucasfilm Limited, LucasArts Entertainment Company, or any affiliates. [...] Star Wars is a registered trademark of Lucasfilm Limited [...] (theswca.com)
If, however, you plan to include pictures or if particular spaceship details are critical to your plot, then you should get permission in advance from the franchise owner. In many cases, if your use is well-delimited, won't deprecate the franchise, and won't impinge on their profits, permission will be granted without charge. If you obtain permission to use certain pictures or descriptions, include an “X is used by permission of Y” disclaimer in the novel's endpapers. (Edit: Many books include disclaimers at the foot of the copyright page, ie on the page for “copyright notice, legal notices, publication information, printing history, cataloguing information from a national library, and an ISBN that uniquely identifies the work”. Some books, and some web pages, place that information in a colophon.)
If a more-than-nominal fee is required, then look elsewhere or (as they did in Galaxy Quest) make up an original parody.
Edit: If you want to use specific names like “Star Wars' Imperial-II class Star Destroyers”, it is reasonable to seek permission to do so. Note that the effect on the story due to using specific names like that may be good or bad. If your work is aimed at avid fans, exact names may help. If the audience is more general, having the exact name is less important than having a description; for example “Emperor-class Super Star Destroyer” (a made-up name) seems less useful than “the Emperor's 19km-long, 10-billion-tonne, Star Buster flagship”.
Overly-specific names have problems: First, they rapidly become dated, and after not many years may make the story look old-fashioned or obscure. Second, without some work in setting up the background, they are implausible within the framework of a story that's set far in the future. For example, if the story is set 500 years from now but revolves around a handful of names from the 20th century instead of names from the 25th century, the present-day reader is entitled to disbelieve completely. For example, when do the toys that people are nostalgic about today date from? Mostly from the latter half of the 20th century. People nostalgic about toys from the 15th century are few and far between.