The word ?Ya? in Arabic is for Nida (calling out). It is for Nida Qareeb (calling somebody close or present) or Nida Ba?eed (calling somebody far and away).
There is no doubt in the permissibility of saying ?Yaa Allah? as Allah is Omnipotent and Omnipresent. It is not permissible to say ?Yaa Mustafa? with the belief that Rasulullah [sallallaahu alayhi wasallam] is Omnipresent.
and Allah Ta’ala Knows Best
Mufti Ebrahim Desai