In the DSM, strict adherence to routine is grouped separately from intense, fixated interests (i.e. obsessions). Rainman’s underwear problem was related to the former. If he knew the history of underwear from prehistoric times to the present, all styles and brands, etc., that would be an obsession or intense, fixated interest. His becoming anxious and preoccupied with not having his own underwear came about because of a break in ritual, routine, and sameness. So, in terms of autism, there is a distinct difference.
From the DSM:
2. Insistence on sameness, inflexible adherence to routines, or ritualized patterns or verbal nonverbal behavior (e.g., extreme distress at small changes, difficulties with transitions, rigid thinking patterns, greeting rituals, need to take same route or eat food every day)
3. Highly restricted, fixated interests that are abnormal in intensity or focus (e.g, strong attachment to or preoccupation with unusual objects, excessively circumscribed or perseverative interest).