It's within the rules, and considering that the time setting is 30 minutes, if your opponents are flagging it really means they aren't managing their time optimally. If your opponent has a good amount of time (say 5 minutes) and you believe your position is hopeless, i.e. you judge that your opponent has practically no chance of slipping up so badly that you don't lose, then it would be polite to just resign and save some time.
However, if the position is even slightly unclear, for example being down a piece in a middlegame, it is fully o.k. to play on, given that there's probably a good chance to come back with some tactic.
Either way, it seems to be accepted in bullet chess to throw in suicidal spite checks (sacrificing pieces and queens) to burn off that last 3 seconds of an opponent's time.
I play 30-minute-per-side matches. The situation has arisen more than just a few times where I feel like I'm losing the match, but my opponent has used much more of his clock than I have. In these situations I've modified my strategy to string out the match as long as possible, for example by electing not to trade equal pieces and by clogging up the middle of the board. This has actually worked a number of times, allowing me to win matches on time while being down on points. Is this considered to violate the chess code of honor?