Yes it is possible to upgrade any entity to any other entity.
I've tested it with some outlandish combinations (e.g. burner inserter -> rocket silo).
Due to the huge amount of entities there is no guarantee that anything will work afterwards though.
I'm mostly interested in upgrading blueprints, since the vanilla upgrade planner can't upgrade earth rails to space rails when using SE due to different collision masks.
or earth belts to space belts.