Considering there is a negative connotation with limping in, which makes you look weak, is it ever OK to limp in preflop?
In what situations does limping preflop work and should it be used as part of a bluff if you have good hole cards?
Generally, I would strongly advice against limping. It is a bad strategy. There are some very specific spots were limping might be reasonable, but always raising pre-flop is never wrong. There is a reason limping is considered a weak play.
The biggest advantage of always raising pre-flop is that it allows you to pick up the blinds and perhaps the antes uncontested. This is a big win. Poker isn't about seeing flops and hitting hands, it is about getting chips. Raising puts you into a position to do so.
Another advantage of raising pre-flop is that you can put your opponent on more specific ranges. If you raise pre-flop, your opponents have to be tighter calling and 3-betting, than if you had limped.
Furthermore, raising allows you to play bigger pots with your premium hands.
And last but not least, this is a balanced strategy. You will be raising with both your very good and marginal hands, making it tougher to play against you.
Now onto always limping. Same things can be said, but in the opposite way. Limping will cause you to never pick up any chips uncontested. Your opponents will have wider ranges, making it tough for you to play against them and you won't be playing big pots with your premiums. The only advantage I can think of is that limping will occasionally save you some money with your weaker holdings.
Now a mixed strategy of both. You can chose to raise up, and play big pots with your premium hands and limp with your weak hands. This seems good, but this strategy isn't balanced. Once your opponents have figured out what you are doing, you are too easy to play against. To make this strategy work you would have to sacrifice a lot of premium hands into your limping range, but you will less often take down the pot pre-flop or play big pots. Ultimately this strategy will be less profitable in the long run.
A small point, that I feel is worth it's own answer. People here have good points, but seen as you included in your question title "Beginner question" I just want to offer a piece of advice to keep the game simpler for you.
So you're new to poker, I'd argue never limp, be tight aggressive. If you're the first player in and have a hand you want to play just raise. This will make your decisions easier while you're learning the game. You don't have the experience and wealth of knowledge of when to limp, what you should do when you limp, and more importantly how to fold and not fall into the trap of "well I already limped so I want to see the next card". Limping while learning the game leaves you at the river, facing an all-in call with mid-pair because you limped with a hand you should have folded or raised. My point on this is you raise you define your hand and learn something about your opponents, you limp and you learn nothing about your opponents and do nothing to define your hand strength.
Limping, especially while you're new to the game, is often the cause of so many of your strong hands such as AA or KK getting cracked by something like 6,7 or 8,9, etc.
Now as you become more and more experienced should you start adding a limp into your playbook? 100% absolutely you should. People here have good points about that, Paparazzi advice about an agro player who will always raise a limp is great advice. In these cases abuse them by limping with good strong hands. I'm not going to cover much here as the other answers here give you good reasons for limping, my main point is keep it to a minimum(or just cut it out entirely) until you are comfortable and understanding the game.
If you are willing to mix in some premium hands then it could be OK.
Problem is that you are encouraging calls and other than the blinds you are playing out of position.
You are likely to get raised so you need to be prepared to call. If you are going to limp and then fold to a 4BB raise that is a loosing proposition. Don't have a range that is check fold to even a small raise.
You might end up playing bigger pots as now someone that might call 2.5BB would raise to 4BB. If you are going for pot control it needs to be a passive table.
If you think you are the best post flop player at the table you are encouraging more calls and but other than the blinds you are playing out of position.
You see more small opens now - like 2.5BB. That has some fold equity and if you have a premium hand you have started to build a pot.
For strong hole cards it is more of a slow play than a bluff. If you just limp those like 1/3 or 1/4 of the time to balance you give up a lot. A better play there is to just smooth call a raise. You have disguised your hand, you have a pot, and you have position on at lease one player.
If you limp AA early and it hits it will be hard to get paid off post flop. KK QQ are going to re-raise even a standard raise so you can get more money in pre. You get a raise out of JJ, AK, AQ, AJ, KQ pre to get more money in pre or just take it down. The down side is if you let 4 players call cheap it is likely at least one of them has 2 pair or better.
If you have an aggressive fish behind you that cannot resist raising a limp. I saw a final table where an amateur was determined to outplay Phil Hellmuth and would raise every limp and fold about 1/2 the raises. Phil limped every good hand and raised anything else and just abused the guy.
Late position with fish in the blinds that fold to even small raises unless they are strong. But if you get raised behind they are still going to fold and now you are playing out of position. You would need to have players behind you also abusing the fish. You cannot talk about it openly but if that is just a betting pattern it is not collusion.
If you have a table that is so weak you can limp suited connectors, not get raised pre, and still get action when you hit.
if there are 4 or more players who have limped in before you and you have position it doesnt matter how bad your cards are, either limp in or raise. If you raise youll possibly get the blinds. If you limp and hit the flop hard you play it for max value. If you miss the flop or hit it weak you fold to nearly any bet. If you have a decent hand, bet it and isolate.