Some flanges will slide right off and others are harder than hell to remove. Yeah, just remove the nut, or the nut and washer, and the flange should come off.
There are spline differences, as fordguy79 mentioned. The way you tell if the splines are the same (without removing the flange, or even the nut), is to look at the outside of the flange. The flange will either have a slight groove all the way around it, or it won't. As long as they both do, or don't, then they are the same spline type.
You can just use the rear section of a large bolt pattern driveshaft, instead of messing around with the flanges.