There are potentially 3 issues here: Trademark infringement, copyright infringement, and good story-telling.
If you copy the name of someone else's story or characters, and you create the possibility that, at least potentially, readers might confuse your story with the original, or think that it's an authorized sequel, you could be sued for trademark infringement.
If you copy exact words from someone else's story, or closely parallel their words, you could be guilty of copyright infringement.
Both of these are fairly easy to avoid by just making your own story distinct enough. You can have a character say, "Wow, boot camp is like Full Metal Jacket!" and have some similarities. There's a special exception in copyright law for parody, so if you copy Full Metal Jacket in a way that makes fun of it, or reset it to a fantasy world, etc, you're probably safe.
Of course "you'd probably win if you got sued" is not at all the same as "you don't need to worry about being sued". If a big operation with a hundred lawyers on staff decides to sue you, just defending yourself could wipe you out, even if you win.
But frankly I think the bigger question is good story telling. Copying someone else's story rarely makes for a good story. Readers are going to say, "This is just a rip-off of Full Metal Jacket." If you make it a parody and you do it well and it's funny, maybe you pull it off. But in general I think you're much better off to be original.