There are no rules, and I wouldn't go by HD alone, rather take into account what the familiar can do for its master, and work something out with your DM. Some creatures are only so dangerous when encountered as monsters, but can be great familiars (Eyeball Beholderkin), while others are dangerous as monsters, especially when encountered in numbers, but aren't that great as - solitary - familiars (Stirge).