According to this site, by any chance is usually used in a question, whereas by the way is usually used to start a casual conversation, but there's an example shows it can be used in a question. About asking a question, can I interchangeably use either of them?
1 Answer
The two expressions are not related at all, and so not interchangeable.
"By any chance" is a set expression that always goes with a polite request.
"By the way" is an expression used to change the subject or slightly redirect a conversation. You could do this by making a statement or asking a question, but it's not necessary. There is no special connection between "by the way" and asking questions.