They can be compared insofar that they are both officially communist one party states that used to work together with and support the soviet union. They are different insofar that China opened itself up and became a bit capitalist but state owned while Cuba still has concepts like public property that are understood more in a more orthodox Marxist way.