What effects would being able to capture while castling have? Capturing an enemy piece while castling has been illegal for many decades, and the concept has been solidified in chess history.
But what effects would it have if it were allowed? First, some ground rules.
1). Captures may only take place on the squares where the king and rook land, for obvious reasons. As such, castling cannot be done of an enemy is on b2/b8.
2). The king and rook are capable of both capturing when castling, since it just makes sense that they should be able to.
3). Castling with capture if the king is in check is allowed, as it is merely a complicated capture, one of the 3 ways to get out of check. This is not castling out of check in my opinion.  The king may also castle if their square is occupied by a checking piece, as that is not castling into check, but a long-range capture for the king.
For example, to bring everything together, castling in this position is perfectly legal given that the king and rook have not moved before. The king is moving onto a checking piece's square, the checking piece is being taken by the rook, and both the king and rook are capturing on their landing squares.
[FEN &quot;8/8/8/8/8/8/8/R1qqK2k w - - 0 1&quot;]

1. O-O-O+ {White takes both queens with check, thereby winning the game!}

Note-in this position, the Black queen reached their current squares via promotion and/or capture.

What effect, in endgames and middlegames in particular, would this have on chess, if capturing while castling was legal? What kinds of tactics would become obsolete, and what new ones could arise? To keep them question limited, only a few examples are needed for a sufficient answer. Good, solid examples in which the differences between present rules and these new ones determine, down to the bone, who wins would be appreciated.
Lastly, does anyone know of a joke problem that has been created using this concept?
Not much would be affected, as user @user1583209 noted in a new deleted comment: “ I don't think this would change much. By the time an enemy piece entered that far into your camp usually you would typically have castled already or lost castling rights anyway.”
However, there are at least a few positions in the opening lines that would be influenced at the least. For example, in this line of play Blacks gains a small advantage, at the least, by preventing White from castling kindside.
[FEN &quot;&quot;]

1. e4 b6 2. Nf3 c5 3. d4 Ba6 4. d5 Bxf1 5. Kxf1

But if capturing while castling were allowed, White will be able to castle whilst capturing the bishop, retaining the advantage, not having to take the time to manually castle.
Additionally, as @Chessanator noted in a comment, the Benko Gambit would be the most affeted opening due to having a similar motive in my example.