No it's not clearly. Your code does not make much sense. You create a new dialog and immediately try to use a variable that has not been initialized. You also try to create a new dialog inside your external class.
You need something more like:
MyDialog :
{
int variable1;
int variable2;
Class1* cls = new Class1();
variable1 = < some value >
variable2 = cls->function1(variable1);
}
Class1()
{
int funtion1(int value)
{
int newvalue;
return newvalue;
}
}