Is it permissible for one to masturbate in order not to commit fornication?
This is called committing the milder of the two evils such as eating a carcass in fear of death, and this happens when committing fornication is very likely to occur.
Is it permissible for someone who has forgotten to mention the supplication pertaining to answering the call of nature to say it while in the toilet?
It is disliked for a Muslim to mention Allah while in the toilet, but he/she may recall the supplication in his/her head without uttering it; that is in case he/she had forgotten mentioning it before entering the toilet.
What is the ruling on training dogs that are of benefit?
All perfect praise be to Allah the Lord of the Worlds. May His peace and blessings be upon our Prophet Mohammad and upon all his family and companions.
This is permissible because Allah The Almighty Says (What means): "They ask thee what is lawful to them (as food). Say: lawful unto you are (all) things good and pure: and what ye have taught your trained hunting animals (to catch) in the manner directed to you by Allah. eat what they catch for you, but pronounce the name of Allah over it: and fear Allah. for Allah is swift in taking account." [Al-Ma`idah/4]. However, it is prohibited to keep dogs for no benefit because Salim reported on the authority of his father that Allah's Apostle (PBUH) said: "He who kept a dog other than one meant for hunting or for watching the herd, lost two qirat of his reward every day." [Moslim]. And Allah The Almighty Knows Best.
Is a Muslim is Permitted to Pray Wearing Shoes?
All perfect praise be to Allah The Lord of The Worlds, and may His peace and blessings be upon our Prophet Muhammad and upon all of his family and companions There is no harm for a Muslim to pray wearing shoes or slippers so long as they are pure, since a man asked Anas Ibn Malik: "Did the Prophet (PBUH) use to offer the prayers with his shoes on?" He said: "Yes." Moreover, Ibn Rajab (May Allah have mercy on his soul) said: "Performing prayer wearing slippers/shoes is permissible according the majority of the Muslim scholars." [Fatih Al-Bary,vol.2/pp.274]. And Allah Knows Best.