I do it all the time, and have for a long, long time. It is just a lot easier on bikes that have a dropper post (which I would definitely not clamp on), or stuff mounted to the seat post.
I just make sure that the clamp can tighten evenly over it's entire clamping area. In other words, no cables, housing, or stops being clamped, and the top tube needs to be a consistent cross-section. Otherwise, I won't do it.
Also, I just clamp it as tight as it needs and no more. And it does not need to be clamped very tight, as that is near the balance point for the bike anyway.
However, I would put this in the "don't try this at home" category when giving others advice. I can definitely see how someone not paying attention to any of the things I mention above could mess up their top tube.