I’m having trouble understanding your first two examples, I’m sorry.
For the last one, I would say both “Excuse me for having opened your letter by mistake” and “Excuse my having opened your letter by mistake“ are correct, although probably the most natural way to say this would be “I’m sorry, I opened your letter by mistake.”