Doujinshi are self-published Japanese works such as magazines, novels, and manga. From the description on the Wikipedia page, some of them seem to be akin to visual fan-fiction, though not all.
According to Wikipedia:
Like their mainstream counterparts, dōjinshi are published in a variety of genres and types. However, due to the target audience, certain themes are more prevalent, and there are a few major division points by which the publications can be classified. It can be broadly divided into original works and aniparo—works which parody existing anime and manga franchises.
As in fanfics, a very popular theme to explore is non-canonical pairings of characters in a given show (for dōjinshi based on mainstream publications). Many such publications contain yaoi or yuri (hentai involving two or more males resp. females) motives, either as a part of non-canon pairings, or as a more direct statement of what can be hinted by the main show.
Should questions about these be allowed?