Can there be some glue residue left on the wall when you prime it? Will the new texture and paint hide the imperfections?
Yes there can be some glue left behind. If there is a lot of glue you should use either an oil based or shellac primer, they will stick the best.
Primer and paint won't hide much in the way of imperfections. If anything they will draw attention to these areas. An applied texture will hide a lot, depends on the texture and its thickness. Light textures, light orange peel or a sand texture, hide the least while knockdown and heavy brush textures hide a lot.