Yes you can use ammonia to unclog a drain.
You just mix the ammonia with some boiling hot water and then poor the ammonia and boiling hot water down the drain and it should unclog.
Let the ammonia and boiling hot water sit in the drain for at least 5 to 15 minutes and then pour another pot of boiling hot water down the drain.
You can also pour some baking soda and vinegar down the drain and then let it sit for 20 to 30 minutes and then while that is sitting boil some water and after 20 to 30 minutes you should pour the boiling water down the drain.
If it's not something more solid clogging the drain then the drain should clear.
If not then you may need to snake the drain or remove the P Trap under the drain because something in there could be clogging the drain.