Yes and no.
The other answers have already addressed your confusion regarding feats and class features, but I don't think they've addressed the meat of your question.
There is a way to gain another class's class features: Multiclassing. You can find the full rules for this in the Player's Handbook or Player's Basic Rules chapter 6, "Customization Options". In short, it lets you gain a level in a different class instead of your current class. For example, your hypothetical Fighter could choose to take 1 level of Rogue and thus have the same Sneak Attack as a level 1 Rogue. If the fighter was level 5, he'd become a level 6 character with 5 levels in Fighter and 1 level in Rogue.
Multiclassing, like Feats, is an optional rule. Ask your DM if it's allowed. If it is, ask your DM or other players for help when considering multiclassing. Some class combinations are very effective but others can end up being worse than their individual classes. Unlike Feats, multiclassing requires some more thought and careful planning to be effective.