The line between an inspiration and plagiarism is perhaps sometimes blurry but there's definitely a line.
But you have to steal something, themes at least if you want to create a piece in a style.
Trying composing a blues song without any "stealing".