Yes, of course.
Some ideas:
Easy one with limit sized terrain: create a big room and use a view to wander around. But that doesn't give you an infinite terrain.
Second solution: Have a controller object that is responsible for creating the terrain. It should "always know" where the player position is and what the vivisble area inside the room is. The controller object is then responsible to generate or destroy the tiles and instances that are currently visible or move outside the visible area (plus a given border to avoid unnecessary object/tile creation or deletion).
The biggest issue you will have is to "remember" what the player already saw and to generate new terrain with objects fitting to the surroundings of the visible or known area if you enter some "unknown" area of the terrain/map.
One approach would be to generate a "huge" more or less random map of chunks where each chunk has a given structure/terrain type and so on.
Crashlands does it like that if I remember correctly.
It's a lot of work but that's not a problem of GameMaker, it's the general solution itself. Would be comparable efforts in other game engines as well. To give you a start you could look up some roguelike examples in the Marketplace or some random cave generators to use as a base. Perlin noise might also help you in getting ideas for terrain generation.
I hope it's not your first game project - otherwise you should start with an easy approach ;-)