Yes it is true for some reason mice and other rodents hate the smell of the lavender.
So if you use lavender around areas where mice or other rodents are hanging out the mice or other rodents will usually stay away from those areas.
It does work because I tried it myself and it has kept mice out of my cabinets and off of my countertops where I used to see them run around.
I'm not sure how they were getting into my closed cabinets but somehow they were as they must have been opening the cabinet doors.
What I do is soak cotton balls in lavender essential oils and then place the cotton balls in my cabinets and on my countertops.
I love the scent of lavender so it works for creating a good scent for me in my house and also repels the mice from those areas.