Can it be that a dose of amitriptyline get stuck in the esophagus and causes it to burn?

Sure. Any pill can get stuck in the esophagus and cause a local caustic injury. Some medications are more prone to cause damage but all have the potential.