You can try to do so. People from all over the world try to seek asylum at Canadian embassies. I can't promise that you will succeed.
The more common route is to make the claim either from inside of Canada or at the border, even at the airport.
But, just because you have no family back home doesn't mean that you can succeed a claim for refugee status. You have to have ground for being considered a refugee.
Here are the two grounds for claiming:
A Convention refugee is a person who is outside of their country of nationality or habitual residence and who is unable or unwilling to return to that country because of a well-founded fear of persecution for reasons of race, religion, political opinion, nationality or membership in a particular social group.
Person in need of protection
A person in need of protection is a person in Canada whose removal to their country of nationality or former habitual residence would subject them to the possibility of torture, risk to life, or risk of cruel and unusual treatment or punishment.
If you can make a case for falling within one of these two definitions you can succeeed. If not, it's unlikely you will be permitted to stay in Canada.
If you can afford to hire an immigration lawyer now would be the time to do so if you haven't tried that already.
Please click accept so that I can receive credit for providing you with this information.