When I applied for grad school (long ago) they just said it was better to experience another department. The undergrad classes we similar enough to the grad classes that it was good to see a different approach. So if you had a family reason (spouse's job etc) that meant you needed to stay in the area, then they'd let you apply. Otherwise, they wouldn't write recommendation letters to our department.