Yes, you can, it is done often, and I see nothing wrong with them. Authors often spend years on a book, and it is normal human nature to thank the people that helped you through it.
People don't have to read it, of course, and I wouldn't worry about haters that don't like it, some people find fault with kindness and I don't get that.
Consider movie credits: They now acknowledge everybody that had anything to do with the film, including accountants, assistants, the janitorial staff. What does it cost them? A few frames of film? Not even that, a few megabytes of memory on disk, that's it.
I will agree that you should ask before you name somebody publicly. You can offer to give them a handle, like initials, or an initial for the last name. Leave them off if they don't want it.
Others do want it, sometimes agents and editors appreciate their contributions being credited. It doesn't diminish the work to credit other people for the help or insight they provided.
Many novels provide a "dedications", either in the front somewhere or as a separate page. This often acknowledges both personal and professional help.