Dear @Mahshidshinoda,
Welcome to the Wefugees community and thank you for sharing your friend's situation with us.
There have been many similar threads relating to the question you asked, so I will link some of them for you :-)
I have refugee status in an EU country - can I apply for asylum in another EU country?
The answer I gave here also explains when Dublin applies: Does Dublin III effect me if I seek asylum in Italy?
To sum it up: Dublin applies in your friend's case, as he enters Sweden with a visa from Greece. Of course, it's impossible for me to say if Greece decides differently in an individual case, but the Dublin III Regulations still apply. That means, your friend can apply for asylum in Greece- or, if he does in Sweden, there is a great chance Sweden will send him back.
I hope this helped to answer your question. Please let us know if you need any further assistance.
Kind regards,
Isa