The idea of course, is that it’s okay to interrupt as long as you apologize first.
You might say, for example, “Excuse me. I’m sorry to interrupt, but if I wanted to quickly say ‘hello.'”
One must also practice good judgment when it comes to deciding to stay in the conversation or move along quickly.
It helps to have a feel for the type of conversation you are interrupting. If it’s a private confab, you should move along quickly or perhaps wait for a better time to insert yourself into the situation.