you can use "affedersiniz" for two situations:
1: it can be said that in a question-answer context where the speaker and the hearer do not know each other, it functions as a kind of polite initiator of the communication.
Example: Affedersiniz, bu çanta sizin mi?
or: Affedersiniz beyefendi, saatiniz kaç?
2: when you did something wrong in a formal situation so you must say you are really sorry about this
example: Sebebi benim eşekliğim, affedersin doktor bey.
------------------------------------------
ozur dilerim is an apology - it is I am sorry for an action and asking forgiveness - you are basically requesting a answer back