user18349: Threefold repetition requires that the same "potential for moves". For example, if an en passant move could be played in one position but not another, it does not count as the same position. 
With respect to threefold repetition, would the positions be considered the same if:

In the first position, the king cannot castle because it is in check, pieces are blocking, or for some other reason, but it could castle otherwise.
In the second position, the king cannot castle because it has already moved. 


user4418: According to the FIDE Laws of Chess:

9.2.2 Positions are considered the same if and only if the same player has the move, pieces of the same kind and colour occupy the same squares and the possible moves of all the pieces of both players are the same. Thus positions are not the same if:
9.2.2.1   at the start of the sequence a pawn could have been captured en passant
  9.2.2.2   a king had castling rights with a rook that has not been moved, but forfeited these after moving. The castling rights are lost
  only after the king or rook is moved.

Hence the answer to

With respect to threefold repetition, would the positions be
  considered the same if:
In the first position, the king cannot castle because it is in check,
  pieces are blocking, or for some other reason, but it could castle
  otherwise

Although castling is temporarily prevented the king still has castling rights. They are not lost if castling is temporarily prevented by check or blocking pieces. They are only lost if the king or rook moves.
With regard to:

With respect to threefold repetition, would the positions be
  considered the same if:
In the second position, the king cannot castle because it has already
  moved.

The rules are clear. If the king has lost castling rights since the the first position then the positions are not the same and a draw cannot be claimed.

Does permanent loss of castling rights reset three fold repetition?

Yes. That's what the rule says.

18349: <p>Threefold repetition requires that the same "potential for moves". For example, if an en passant move could be played in one position but not another, it does not count as the same position. </p>

<p>With respect to threefold repetition, would the positions be considered the same if:</p>

<ul>
<li>In the first position, the king cannot castle because it is in check, pieces are blocking, or for some other reason, but it could castle otherwise.</li>
<li>In the second position, the king cannot castle because it has already moved. </li>
</ul>
 4418: <p>According to the FIDE Laws of Chess:</p>

<blockquote>
  <p>9.2.2 Positions are considered the same if and only if the same player has the move, pieces of the same kind and colour occupy the same squares and the possible moves of all the pieces of both players are the same. Thus positions are not the same if:</p>
  
  <p>9.2.2.1   at the start of the sequence a pawn could have been captured en passant<br>
  9.2.2.2   a king had <strong>castling rights</strong> with a rook that has not been moved, but forfeited these after moving. The castling rights are lost
  only after the king or rook is moved.</p>
</blockquote>

<p>Hence the answer to</p>

<blockquote>
  <p>With respect to threefold repetition, would the positions be
  considered the same if:</p>
  
  <p>In the first position, the king cannot castle because it is in check,
  pieces are blocking, or for some other reason, but it could castle
  otherwise</p>
</blockquote>

<p>Although castling is temporarily prevented the king still has <strong>castling rights</strong>. They are not lost if castling is temporarily prevented by check or blocking pieces. They are only lost if the king or rook moves.</p>

<p>With regard to:</p>

<blockquote>
  <p>With respect to threefold repetition, would the positions be
  considered the same if:</p>
  
  <p>In the second position, the king cannot castle because it has already
  moved.</p>
</blockquote>

<p>The rules are clear. If the king has lost castling rights since the the first position then the positions are not the same and a draw cannot be claimed.</p>

<blockquote>
  <p>Does permanent loss of castling rights reset three fold repetition?</p>
</blockquote>

<p>Yes. That's what the rule says.</p>
