They say imitation is the greatest form of flattery, I have to disagree...
Imitation is so close to plagiarism, especially in writing. I even find "fan fiction" sometimes to be icky. Unless you knew, or were told, its hard image that "Fifty Shades of Grey" is fan-fiction of the "Twilight" series. But, it is. And the author is very forthright about that. So I'm not talking about getting inspiration from someone, and creating your own world; I'm talking about people who just blatantly rip off other people's work, and pass it off as their own. Is it flattering? Hell, no! That's stealing.
When I was doing research on the legal no-no's and of what I could be sued for while writing "Yours Truly, 2095," I came across an article by an entertainment lawyer. He said that ideas can not be copyrighted. Only the specific words inside. His example was, if someone wanted to write a novel (or make a movie) about a killer Great White shark that terrorizes a small beach community, and the main character is a lone Sheriff, and name the book/movie "Jaws," there is no legal action that Peter Benchley or Steven Spielberg can take. However, if one sentence from the book is included, or a piece of dialogue from the movie, than BAM! Dead to rights. So that gives a lot of "hacks" a lot of wiggle room to play with when it comes to "imitating" their favorite works.
I would say that acknowledging inspiration as a direct line into your work is the truest form of flattery. But trying to rewrite someone else's novel and pass it off as unique, or remake someone else's movie and pass it off as innovating (and I'm NOT talking about actual remakes and reboots), or even writing a song that is a blatant rip off as someone else's and taking credit for its "genius." (Case in point, this headline from last year: Pharrell Williams and Robin Thicke to pay $7.4m to Marvin Gaye's family over Blurred Lines)
Create your own world, even if you are borrowing from someone else's imagination. Write your own song, even if you are using another band's style as foundation. make your own movie, even if you are tapping into someone else's vision. Just be original, and pay homage... don't imitate.