So, say I use thief on a Silvally holding a bug memory. Is it possible for me to take its memory off, or will it fail like it does on a Blastoise holding a mega stone?
Memories cannot be taken off if using moves such as Knock Off, Thief, Switcheroo, and Trick.
Item-manipulating effects (such as Trick and Fling) cannot give Silvally a memory or remove a memory from Silvally.
Source (applies to all other memories as well) and Experience.
Thief cannot steal a Mega Stone or Orb if either the user or the target could use it to Mega Evolve or undergo Primal Reversion, a Z-Crystal from any Pokémon, or a memory if either the user or the target is Silvally.
No
Source: https://bulbapedia.bulbagarden.net/wiki/Thief_(move)