It should depend on the level of the formality of the writing. In a strictly academic paper, it should probably be avoided completely. If the paper is slightly less formal, it may be acceptable, but the author should take care to specify that it is a work of fiction, that it is a theoretical example and not evidence, and what scope of the example is applicable to the discussion. This should be combined with actual evidence supporting the possibility and relevance of the example.
It should depend on the level of the formality of the writing. In a strictly academic paper, it should probably be avoided completely. If the paper is slightly less formal, it may be acceptable, but the author should take care to specify that it is a work of fiction, that it is a theoretical example and not evidence, and what scope of the example is applicable to the discussion. This should be combined with actual evidence supporting the possibility and relevance of the example.