#JavaScript (ES6), 114 bytes

Takes input as an array of strings. Returns `0` or `1`.

<!-- language: lang-js -->

    a=>(C={},F=x=>!C[c=a[y][x]]|(g=v=>(a[y+v]||[])[x]==c)(-1)|g(1)|g(0,x--)|g(0,x+=2)?a[y+=!c]?F(C[c]=c?x:0):1:0)(y=0)

###Test cases

<!-- begin snippet: js hide: true console: true babel: false -->

<!-- language: lang-js -->

    let f =

    a=>(C={},F=x=>!C[c=a[y][x]]|(g=v=>(a[y+v]||[])[x]==c)(-1)|g(1)|g(0,x--)|g(0,x+=2)?a[y+=!c]?F(C[c]=c?x:0):1:0)(y=0)

    console.log(f([ // 1
      "A"
    ]))

    console.log(f([ // 1
      "AB",
      "AB"
    ]))

    console.log(f([ // 0
      "AB",
      "BA"
    ]))

    console.log(f([ // 1
      "ABCDE"
    ]))

    console.log(f([ // 0
      "ABCDC"
    ]))

    console.log(f([ // 1
      "**::dd22",
      "***:d222",
      "*:::::22"
    ]))

    console.log(f([ // 0
      "$$$%%%&&",
      "$$%%&&&&",
      "&&$$$%&&"
    ]))

    console.log(f([ // 1
      "AABBCDDDE",
      "ABBCCCDEE",
      "ABCCCCDDE",
      "AACCCDDEE",
      "AAAACCCCE",
      "AAAAAACCC"
    ]))

    console.log(f([ // 1
      "AABB",
      "ABBA",
      "AAAA"
    ]))

    console.log(f([ // 1
      "AAAB",
      "AAAA",
      "AAAA"
    ]))


<!-- end snippet -->