Yes the #40 and #41 chain are the same chain essentially... however, the #40 is a wider width link (side to side... not link to link). So a #40 chain, will 'fit' a #41 tooth gear/sprocket... BUT, due to the width, a #41 chain wont fit a #40 tooth gear/sprocket.
It 'IS' recommended however, to get the proper chain for the proper tooth gear/sprocket... but asfar as 'will it work?"... yes... if you are running a #40 chain on a #41 tooth gear/sprocket... but not the other way around.
Normally, a #41 is recommended inplace of a #40, due to clearance... normally.