Thanks for inviting me (as your guest) can be translated as Спасибо что пригласили
Thank you for having me (as your guest) can be translated as Спасибо что разрешили мне быть вашим гостем

But I'm not native English speaker and could be wrong here

Is it used in other situations?
well the verb have is translated as иметь and has the same all meanings, including dirty one