No, she did not hallucinate the interaction.
"That's not you" is a reference to Season 1 of Game of Thrones, in which Arya tells her father, Ned Stark, "That's not me" in response to her having to go to court and marry a prince.
Eddard Stark: You will marry a high lord and rule this castle, and your sons shall be knights and princes and lords (smiles) Hmm?
Arya Stark: No... That's not me
—Game of Thrones, S01E04, Cripples, Bastards, and Broken Things
After this touching moment with Nymeria, in which she pleas for her to come with Arya to Winterfell, she realises that Nymeria belongs with her pack, out in the wild, not as a pet or companion, and she comes to this realisation poetically, by using a variation on her own words, "That's not you".
This has been confirmed to be the official answer by the production crew in behind the scenes or commentary blogs/programmes like HBO's official Making Game Of Thrones website:
Back in Season 1, Ned Stark comes across his younger daughter balancing on the stairs in a Red Keep hallway. Sitting together, he offers Arya a glimpse of what her happy future could be: marriage and children. Knowing herself even then, the young girl looks at her father and simply says, “No, That’s not me.”
Now in Season 7, Arya asks her direwolf to come home with her, but is rejected by the creature. Disappointed at first, she realizes that, just like her, Nymeria is not meant to be tamed.
—Making Game of Thrones Blog, "Did You Catch This Thrones Throwback in ‘Stormborn’?"
As well as by series creators, David Benioff and D.B. Weiss, in HBO's Inside the Episode, in which they explore the episode.
David Benioff: This scene hearkens back to Season 1.
[...]
D.B. Weiss: "That's not you" is a direct reference to what Arya herself said to her father when her father painted this picture for her of the life she could have as the lady of a castle, and marrying some lord, and wearing a nice frilly dress.
Arya is not domesticated and it makes total sense that her wolf wouldn't be either. And once the wolf walks away, at first she's heartbroken to have come this close, then she realises that the wolf is doing exactly what she would do if she were that wolf.
—Game of Thrones: Season 7 Episode 2: Inside the Episode (HBO)