Is it ok to put the telegraph from full ahead directly to stop engine during emergencies? What will be the consequences?

I am not sure if you meant "Full Ahead" or "Full away". But I will answer with both scenarios.

Full away to Stop

Let us say that the ship is proceeding at sea with navigation full (Full away) speed. Now if we put the telegraph to "STOP", nothing would happen and the engine will continue to run at Full RPM.

This is because after the "Commencement of Sea Passage" the engine control would be with the engine room. If we put the telegraph to "Stop" all that will happen is that there will be an alarm in the engine room for both the telegraphs not being in sync. 

Full Ahead to Stop

Now let us say that the ship is maneuvering at full ahead. In an emergency, if you wish to put the telegraph to "Stop", what will happen? Again there will not be any harm. 

The engine's "load program" will activate, the rpm will start reducing slowly and after sometimes the RPM will become zero.

I see it so many times during maneuvering that when I order "Slow ahead" from "Full Ahead" (or "Stop" from "half ahead"), the duty officer would put the telegraph first to "half ahead' then wait for some time and then put it to "slow ahead".

Ideally, if we need to go to "Slow ahead" from "Full Ahead" during maneuvering, we can just go to "Slow ahead" directly without waiting with the telegraph at "half ahead' position.

There are limiters set in the modern engines and these limiters take care of gradually reducing the RPM irrespective of the command given from the wheelhouse.   

But if you need to have the engines stopped faster, then you need to cancel the limits by pressing this button.

This would cancel certain limits to stop the engine faster.

But if you are in the dire emergency state, you need to initiate "Crash stop" or "crash astern procedures". These procedures are posted on the wheelhouse and navigators must know about it.

In any case,  while informing the engine room about these procedures being initiated, do not forget to declare the emergency by using the word "emergency".