I noticed that Andrew's put a sign on saying: "WARNING Place dragon egg at own risk!!!". There is a way to get your egg back, namely dropping it on flowers. Spoiler: Picture of Andrew's sign I made this video to show you guys how to do this. Thank you TopicDogg for the useful information.
Another way it to start breaking the block next to it then moving your cursor over to the dragon egg whilst still holding the left mouse button down and it will break. Much easier. I believe his warning was because simply hitting it would make it teleport and it could go anywhere.