Of course, it looks best if the gazebo stands freely on a lawn. If you have less space available in your garden, there is the option of choosing a gazebo that is designed to stand against a wall.
This then has no window frontage on one side, for example. So if you have a garden, there is nothing to stop you from having a gazebo.