Skip Oliva lists eight unlikely, but technically possible, constitutional scenarios:
I knew a guy in college named Derek, who was working for some House member at the time. Derek said he always dreamed about being the first non-member of the House to be elected speaker. There’s nothing that would prohibit that. The Constitution simply states, “The House of Representatives shall chuse their Speaker and other officers.” It doesn’t say anything about who is qualified to be elected speaker. Of course, the House has always chosen a member as speaker in practice.