If you are up front about your intentions to the interviewer, it's up to them whether they want to interview you or not. Any hiring manager worth their salt would not turn down an offer to interview a good candidate, even if they're not hiring right now. Having one or two great candidates in your back pocket is always handy. Even if that candidate isn't available when you need them, if they had a good experience with you, they'll likely refer someone to you. And, as the hiring manager, maybe you want to move somewhere else, and now you have relationships with good people at other companies. Networking is a long game; don't get annoyed, play to win!