It might work but it's not recommended because, according to documentation, surfaces are unstable, so their memory gets overwritten really easily. So if you're trying to redraw the surface from a previous step something funky might happen with the graphics. And if you've just created the surface there's nothing to draw using this code. Keeping surfaces past a step can also result in memory issues.
If you're trying to apply shaders to images created as surfaces there are better ways to do it.
e.g.
GML:
//create surface
//surface set target
//draw sprites
//surface reset target
//set shader
//draw surface
//reset shader
or
GML:
//surface set target
//draw sprites
//surface reset target
sprite_create_from_surface();
//set shader
//draw sprite
//reset shader
If you create a sprite, you can use it outside of the step.
In either case, you'll want to delete the info at the end of the step to avoid memory leaks and crashes. For surfaces, use surface_free(), and for created sprites, especially if it is being created every step, use
if (sprite_exists(sprite_name)) sprite_delete(sprite_name)
in the draw end or draw GUI end event (do it in one of these, because if you do it in the draw or draw GUI event it'll make the sprite a white box).
If you have something specific you're trying to achieve, I or many others would be happy to help.